diff options
author | Peter Moody <python@hda3.com> | 2013-10-21 20:58:06 (GMT) |
---|---|---|
committer | Peter Moody <python@hda3.com> | 2013-10-21 20:58:06 (GMT) |
commit | 22c31764262b02338265a059c738b8d24fd9a0e4 (patch) | |
tree | 17e03bb96bb29be8b822eb10267ee25adc0a04de /Lib/test/test_ipaddress.py | |
parent | b7ddbc855cdab3563f25bd4e9e759a46648f95e0 (diff) | |
download | cpython-22c31764262b02338265a059c738b8d24fd9a0e4.zip cpython-22c31764262b02338265a059c738b8d24fd9a0e4.tar.gz cpython-22c31764262b02338265a059c738b8d24fd9a0e4.tar.bz2 |
#17400; ipaddress should make it easy to identify rfc6598 addresses
Diffstat (limited to 'Lib/test/test_ipaddress.py')
-rw-r--r-- | Lib/test/test_ipaddress.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_ipaddress.py b/Lib/test/test_ipaddress.py index 99c54f1..c2a2009 100644 --- a/Lib/test/test_ipaddress.py +++ b/Lib/test/test_ipaddress.py @@ -1319,6 +1319,11 @@ class IpaddrUnitTest(unittest.TestCase): self.assertEqual(True, ipaddress.ip_network( '127.42.0.0/16').is_loopback) self.assertEqual(False, ipaddress.ip_network('128.0.0.0').is_loopback) + self.assertEqual(True, ipaddress.ip_network('100.64.0.0/10').is_private) + self.assertEqual(True, + ipaddress.ip_network('192.0.2.128/25').is_private) + self.assertEqual(True, + ipaddress.ip_network('192.0.3.0/24').is_global) # test addresses self.assertEqual(True, ipaddress.ip_address('0.0.0.0').is_unspecified) @@ -1384,6 +1389,10 @@ class IpaddrUnitTest(unittest.TestCase): self.assertEqual(False, ipaddress.ip_network('::1').is_unspecified) self.assertEqual(False, ipaddress.ip_network('::/127').is_unspecified) + self.assertEqual(True, + ipaddress.ip_network('2001::1/128').is_private) + self.assertEqual(True, + ipaddress.ip_network('200::1/128').is_global) # test addresses self.assertEqual(True, ipaddress.ip_address('ffff::').is_multicast) self.assertEqual(True, ipaddress.ip_address(2**128 - 1).is_multicast) |