summaryrefslogtreecommitdiff
path: root/Lib/test/test_ipaddress.py
diff options
context:
space:
mode:
authorEric V. Smith <eric@trueblade.com>2014-04-14 12:58:07 -0400
committerEric V. Smith <eric@trueblade.com>2014-04-14 12:58:07 -0400
commitb37ff07d3b8baa817959cefee8c1e8996f9f0eaa (patch)
tree621202f4cff9ca251ff1550c0b71c8bf247ab92b /Lib/test/test_ipaddress.py
parent3f942e0f96b7c9ff22255272c3ef10878aa5f86d (diff)
downloadcpython-b37ff07d3b8baa817959cefee8c1e8996f9f0eaa.tar.gz
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.py8
1 files changed, 8 insertions, 0 deletions
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,