def test_is_ip(self): self.assertTrue(primatives.is_ip('127.0.0.1:18000'))
def test_is_ip_no_port(self): self.assertFalse(primatives.is_ip('127.0.0.1'))
def test_is_ip_greater_than_255(self): self.assertFalse(primatives.is_ip('127.999.0.1:18000'))
def test_is_ip_less_than_0(self): self.assertFalse(primatives.is_ip('-127.0.0.1:18000'))
def test_is_ip_more_than_4_comps(self): self.assertFalse(primatives.is_ip('127.0.0.1.8:18000'))
def test_is_ip_non_numerics(self): self.assertFalse(primatives.is_ip('127.0.X.1:18000'))
def test_is_ip_not_string(self): self.assertFalse(primatives.is_ip(123))
def test_has_port_more_than_65535(self): self.assertFalse(primatives.is_ip('127.0.0.1:99999'))
def test_has_port_less_than_1024(self): self.assertFalse(primatives.is_ip('127.0.0.1:1'))
def test_has_port_more_than_2_components(self): self.assertFalse(primatives.is_ip('127.0.0.1:4444:5555'))
def test_has_port_not_digit(self): self.assertFalse(primatives.is_ip('127.0.0.1:X'))