Exemple #1
0
 def test_10d_invalid_ipv6_bogus_entry(self):
     """
     Verify that an ipv6 that contains a non-hex entry is rejected.
     """
     test = "0000:1111:2222:3333:good:5555:6666:7777"
     assert not validate_ip_address(test), "bogus entry ipv6 accepted"
Exemple #2
0
 def test_10b_invalid_ipv6_long(self):
     """
     Verify that an ipv6 that is long an entry is rejected.
     """
     test = "0000:1111:2222:3333:4444:5555:6666:7777:8888"
     assert not validate_ip_address(test), "long ipv6 accepted"
Exemple #3
0
 def test_10c_invalid_ipv6_high_number(self):
     """
     Verify that an ipv6 that is long an entry is rejected.
     """
     test = "10000:1111:2222:3333:4444:5555:6666:7777"  # first entry over FFFF
     assert not validate_ip_address(test), "high entry ipv6 accepted"
Exemple #4
0
 def test_09c_validate_ipv6_very_compressed(self):
     """
     Verify that an ipv6 that is 0 compressed is rejected.
     """
     test = "1111::8888"  # same as 1111:0000:0000:0000:0000:0000:0000:8888
     assert validate_ip_address(test)
Exemple #5
0
 def test_10a_invalid_ipv6_short(self):
     """
     Verify that an ipv6 that is short an entry is rejected.
     """
     test = "0000:1111:2222:3333:4444:5555:6666"
     assert not validate_ip_address(test), "short ipv6 accepted"
Exemple #6
0
 def test_09a_validate_ipv6(self):
     """
     Verify that an valid ipv6 is accepted.
     """
     test = "0000:1111:2222:3333:4444:5555:6666:7777"
     assert validate_ip_address(test)
Exemple #7
0
 def test_09b_validate_ipv6_compressed(self):
     """
     Verify that an valid compressed ipv6 is accepted.
     """
     test = "0:1:22:333:444:55:6:7"  # same as 0000:0001:0022:0333:0444:0055:0006:0007
     assert validate_ip_address(test)
Exemple #8
0
 def test_08e_invalid_ipv4_empty_entry(self):
     """
     Verify that an ipv4 that contains an empty entry is rejected.
     """
     test = "11.22..44"
     assert not validate_ip_address(test), "ipv4 with empty entry accepted"
Exemple #9
0
 def test_08f_invalid_ipv4_bogus(self):
     """
     Verify that an ipv4 that contains an empty entry is rejected.
     """
     test = "aa.bb.cc.dd"
     assert not validate_ip_address(test), "bogus ipv4 accepted"
Exemple #10
0
 def test_08d_invalid_ipv4_low_entry(self):
     """
     Verify that an ipv4 that contains a negative entry is rejected.
     """
     test = "11.22.-33.44"
     assert not validate_ip_address(test), "ipv4 with negative entry accepted"
Exemple #11
0
 def test_08c_invalid_ipv4_high_number(self):
     """
     Verify that an ipv4 that contains an entry over 255 is rejected.
     """
     test = "11.22.333.44"
     assert not validate_ip_address(test), "ipv4 with excessive entry accepted"
Exemple #12
0
 def test_08b_invalid_ipv4_long(self):
     """
     Verify that an ipv4 that is long an entry is rejected.
     """
     test = "11.22.33.44.55"
     assert not validate_ip_address(test), "long ipv4 accepted"
Exemple #13
0
 def test_08a_invalid_ipv4_short(self):
     """
     Verify that an ipv4 that is short an entry is rejected.
     """
     test = "11.22.33"
     assert not validate_ip_address(test), "short ipv4 accepted"
Exemple #14
0
 def test_07a_validate_ipv4(self):
     """
     Verify that an valid ipv4 is accepted.
     """
     test = "11.22.33.44"
     assert validate_ip_address(test)