def test_loopback6(self): """IPv6 loopback address""" det = IP("::1") self.assertEquals(det.asn, None) self.assertEquals(det.is_querable(), False) # no query to stat self.assertEquals(self.mock_get.call_count, 0) # no access to cache get self.assertEquals(self.mock_cache.get.call_count, 0)
def test_is_querable1(self): """Test case where IP is not quearable""" ip = IP("127.0.0.1") self.assertFalse(ip.is_querable())
def test_is_querable(self): """Test case where IP is quearable""" ip = IP(self.IP) self.assertTrue(ip.is_querable())