diff options
author | Eric V. Smith <eric@trueblade.com> | 2014-04-14 16:58:07 (GMT) |
---|---|---|
committer | Eric V. Smith <eric@trueblade.com> | 2014-04-14 16:58:07 (GMT) |
commit | ebdaaf40875fb8e29c7fbad5cc67221123995a8e (patch) | |
tree | 4feedc5959563cc17fdb855348951a88e7c4c598 /Lib/test/test_ipaddress.py | |
parent | 6b2308803506321019bfe2ec1f2303ebb97ec998 (diff) | |
download | cpython-ebdaaf40875fb8e29c7fbad5cc67221123995a8e.zip cpython-ebdaaf40875fb8e29c7fbad5cc67221123995a8e.tar.gz cpython-ebdaaf40875fb8e29c7fbad5cc67221123995a8e.tar.bz2 |
Issue #20480: Add ipaddress.reverse_pointer. Patch by Leon Weber.
Diffstat (limited to 'Lib/test/test_ipaddress.py')
-rw-r--r-- | Lib/test/test_ipaddress.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_ipaddress.py b/Lib/test/test_ipaddress.py index f2947b9..33adb3b 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, |