|
|
@ -1383,20 +1383,16 @@ class DNSUtilsNetworkTests(unittest.TestCase):
|
|
|
|
self.assertEqual(res, None)
|
|
|
|
self.assertEqual(res, None)
|
|
|
|
|
|
|
|
|
|
|
|
def testAddr2bin(self):
|
|
|
|
def testAddr2bin(self):
|
|
|
|
res = DNSUtils.addr2bin('10.0.0.0')
|
|
|
|
res = IPAddr('10.0.0.0')
|
|
|
|
self.assertEqual(res, 167772160L)
|
|
|
|
self.assertEqual(res.addr, 167772160L)
|
|
|
|
res = DNSUtils.addr2bin('10.0.0.0', cidr=None)
|
|
|
|
res = IPAddr('10.0.0.0', cidr=None)
|
|
|
|
self.assertEqual(res, 167772160L)
|
|
|
|
self.assertEqual(res.addr, 167772160L)
|
|
|
|
res = DNSUtils.addr2bin('10.0.0.0', cidr=32L)
|
|
|
|
res = IPAddr('10.0.0.0', cidr=32L)
|
|
|
|
self.assertEqual(res, 167772160L)
|
|
|
|
self.assertEqual(res.addr, 167772160L)
|
|
|
|
res = DNSUtils.addr2bin('10.0.0.1', cidr=32L)
|
|
|
|
res = IPAddr('10.0.0.1', cidr=32L)
|
|
|
|
self.assertEqual(res, 167772161L)
|
|
|
|
self.assertEqual(res.addr, 167772161L)
|
|
|
|
res = DNSUtils.addr2bin('10.0.0.1', cidr=31L)
|
|
|
|
res = IPAddr('10.0.0.1', cidr=31L)
|
|
|
|
self.assertEqual(res, 167772160L)
|
|
|
|
self.assertEqual(res.addr, 167772160L)
|
|
|
|
|
|
|
|
|
|
|
|
def testBin2addr(self):
|
|
|
|
|
|
|
|
res = DNSUtils.bin2addr(167772160L)
|
|
|
|
|
|
|
|
self.assertEqual(res, '10.0.0.0')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def testIPAddr_Equal6(self):
|
|
|
|
def testIPAddr_Equal6(self):
|
|
|
|
self.assertEqual(
|
|
|
|
self.assertEqual(
|
|
|
|