示例#1
0
 def test_alerts_invalid_ipv6(self):
     ip = Parameter('ip')
     ip.set('2001:db8::2:q1')
     validator = Ipv6Validator(ip)
     self.assertRaises(EnvironmentError, validator)
示例#2
0
 def test_alerts_invalid_ipv4(self):
     ip = Parameter('ip')
     ip.set('192.168.1-1')
     validator = Ipv4Validator(ip)
     self.assertRaises(EnvironmentError, validator)
示例#3
0
 def test_validates_ipv6(self):
     ip = Parameter('ip')
     ip.set('2001:db8::2:1')
     validator = Ipv6Validator(ip)
     validator()
示例#4
0
 def test_validates_ipv4(self):
     ip = Parameter('ip')
     ip.set('192.168.1.1')
     validator = Ipv4Validator(ip)
     validator()