Пример #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"
Пример #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"
Пример #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"
Пример #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)
Пример #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"
Пример #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)
Пример #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)
Пример #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"
Пример #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"
Пример #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"
Пример #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"
Пример #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"
Пример #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"
Пример #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)