From ebdaaf40875fb8e29c7fbad5cc67221123995a8e Mon Sep 17 00:00:00 2001 From: "Eric V. Smith" Date: Mon, 14 Apr 2014 12:58:07 -0400 Subject: Issue #20480: Add ipaddress.reverse_pointer. Patch by Leon Weber. --- Lib/test/test_ipaddress.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Lib/test/test_ipaddress.py') diff --git a/Lib/test/test_ipaddress.py b/Lib/test/test_ipaddress.py index f2947b9c8a..33adb3b35a 100644 --- a/Lib/test/test_ipaddress.py +++ b/Lib/test/test_ipaddress.py @@ -1593,6 +1593,14 @@ class IpaddrUnitTest(unittest.TestCase): addr3.exploded) self.assertEqual('192.168.178.1', addr4.exploded) + def testReversePointer(self): + addr1 = ipaddress.IPv4Address('127.0.0.1') + addr2 = ipaddress.IPv6Address('2001:db8::1') + self.assertEqual('1.0.0.127.in-addr.arpa', addr1.reverse_pointer) + self.assertEqual('1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.' + + 'b.d.0.1.0.0.2.ip6.arpa', + addr2.reverse_pointer) + def testIntRepresentation(self): self.assertEqual(16909060, int(self.ipv4_address)) self.assertEqual(42540616829182469433547762482097946625, -- cgit v1.2.1