def test_too_many_numbers(self): self.assertFalse(is_ip_address("8.8.8.8.8"))
def test_too_large_numbers(self): self.assertFalse(is_ip_address("999.999.999.999")) self.assertFalse(is_ip_address("256.1.1.1")) self.assertFalse(is_ip_address("1.355.1.1")) self.assertFalse(is_ip_address("1.1.260.1"))
def test_edge_cases(self): self.assertTrue(is_ip_address("255.255.255.255")) self.assertTrue(is_ip_address("0.0.0.0"))
def test_mixed_length_ip(self): self.assertTrue(is_ip_address("74.118.212.1"))
def test_localhost(self): self.assertTrue(is_ip_address("127.0.0.1"))
def test_google_dns(self): self.assertTrue(is_ip_address("8.8.8.8"))
def test_spaces(self): self.assertFalse(is_ip_address("192.168.1.1 ")) self.assertFalse(is_ip_address(" 192.168.1.1"))
def test_local_ip(self): self.assertTrue(is_ip_address("192.168.1.1"))