fix test for invalid IP (use TEST-NET-1 according to RFC 5737):

since fef031b3cd failed, because on some platforms like vm:debian 10.0.0.0 returns 'localhost' (intern network).
pull/1002/head
sebres 2015-03-25 01:10:53 +01:00
parent d28880fdca
commit c5ba76aab8
1 changed files with 2 additions and 1 deletions

View File

@ -1023,7 +1023,8 @@ class DNSUtilsTests(unittest.TestCase):
def testIpToName(self): def testIpToName(self):
res = DNSUtils.ipToName('66.249.66.1') res = DNSUtils.ipToName('66.249.66.1')
self.assertEqual(res, 'crawl-66-249-66-1.googlebot.com') self.assertEqual(res, 'crawl-66-249-66-1.googlebot.com')
res = DNSUtils.ipToName('10.0.0.0') # invalid ip (TEST-NET-1 according to RFC 5737)
res = DNSUtils.ipToName('192.0.2.0')
self.assertEqual(res, None) self.assertEqual(res, None)
def testAddr2bin(self): def testAddr2bin(self):