예제 #1
0
def test_open_and_append_on_file_with_valid_ipv6_address():
    IPValidator.remove_file('test_file_ValidIPs.txt')
    valid_ips_file_name = 'test_file_ValidIPs.txt'
    address = '2001:0db8:85a3:0000:0000:8a2e:0370:7334'
    version = 'IPv6'
    IPValidator.open_and_append_on_file(valid_ips_file_name, address, version)
    file = IPValidator.file_append(
        address,
        valid_ips_file_name,
        version
    )

    assert file.close
예제 #2
0
def test_open_and_append_on_invalid_ip_address_file():
    IPValidator.remove_file('test_file_invalidIPs.txt')
    valid_ips_file_name = 'test_file_invalidIPs.txt'
    address = '902903920392'
    version = 'Invalid IP'
    IPValidator.open_and_append_on_file(valid_ips_file_name, address, version)
    file = IPValidator.file_append(
        address,
        valid_ips_file_name,
        version
    )

    assert file.close
예제 #3
0
def test_open_and_append_on_file_with_valid_ipv4_address():
    IPValidator.remove_file('test_file_ValidIPs.txt')
    valid_ips_file_name = 'test_file_ValidIPs.txt'
    address = '10.10.1.1'
    version = 'IPv4'
    IPValidator.open_and_append_on_file(valid_ips_file_name, address, version)
    file = IPValidator.file_append(
        address,
        valid_ips_file_name,
        version
    )

    assert file.close