Beispiel #1
0
 def testIp4AddrNegatives(self):
     self.assertFalse(is_valid_ip4_address('0.0.0.0.0'))
     self.assertFalse(is_valid_ip4_address('1.2.3'))
     self.assertFalse(is_valid_ip4_address('a2.34.56.78'))
     self.assertFalse(is_valid_ip4_address('255.255.255.256'))
Beispiel #2
0
 def testDestAddr1(self):
     self.assertTrue(is_valid_ip4_address(to_ip('www.wikipedia.org')))
     self.assertRaises(socket.gaierror, to_ip, ('www.doesntexist.tld'))
Beispiel #3
0
 def testIp4AddrPositives(self):
     self.assertTrue(is_valid_ip4_address('0.0.0.0'))
     self.assertTrue(is_valid_ip4_address('1.2.3.4'))
     self.assertTrue(is_valid_ip4_address('12.34.56.78'))
     self.assertTrue(is_valid_ip4_address('255.255.255.255'))