예제 #1
0
 def test_is_ip(self):
     self.assertTrue(primatives.is_ip('127.0.0.1:18000'))
예제 #2
0
 def test_is_ip_no_port(self):
     self.assertFalse(primatives.is_ip('127.0.0.1'))
예제 #3
0
 def test_is_ip_greater_than_255(self):
     self.assertFalse(primatives.is_ip('127.999.0.1:18000'))
예제 #4
0
 def test_is_ip_less_than_0(self):
     self.assertFalse(primatives.is_ip('-127.0.0.1:18000'))
예제 #5
0
 def test_is_ip_more_than_4_comps(self):
     self.assertFalse(primatives.is_ip('127.0.0.1.8:18000'))
예제 #6
0
 def test_is_ip_non_numerics(self):
     self.assertFalse(primatives.is_ip('127.0.X.1:18000'))
예제 #7
0
 def test_is_ip_not_string(self):
     self.assertFalse(primatives.is_ip(123))
예제 #8
0
 def test_has_port_more_than_65535(self):
     self.assertFalse(primatives.is_ip('127.0.0.1:99999'))
예제 #9
0
 def test_has_port_less_than_1024(self):
     self.assertFalse(primatives.is_ip('127.0.0.1:1'))
예제 #10
0
 def test_has_port_more_than_2_components(self):
     self.assertFalse(primatives.is_ip('127.0.0.1:4444:5555'))
예제 #11
0
 def test_has_port_not_digit(self):
     self.assertFalse(primatives.is_ip('127.0.0.1:X'))