summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ipaddress.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_ipaddress.py')
-rw-r--r--Lib/test/test_ipaddress.py37
1 files changed, 29 insertions, 8 deletions
diff --git a/Lib/test/test_ipaddress.py b/Lib/test/test_ipaddress.py
index 0e39516..5d96330 100644
--- a/Lib/test/test_ipaddress.py
+++ b/Lib/test/test_ipaddress.py
@@ -1405,14 +1405,35 @@ class IpaddrUnitTest(unittest.TestCase):
ipaddress.ip_address('::2'))
def testInterfaceComparison(self):
- self.assertTrue(ipaddress.ip_interface('1.1.1.1') <=
- ipaddress.ip_interface('1.1.1.1'))
- self.assertTrue(ipaddress.ip_interface('1.1.1.1') <=
- ipaddress.ip_interface('1.1.1.2'))
- self.assertTrue(ipaddress.ip_interface('::1') <=
- ipaddress.ip_interface('::1'))
- self.assertTrue(ipaddress.ip_interface('::1') <=
- ipaddress.ip_interface('::2'))
+ self.assertTrue(ipaddress.ip_interface('1.1.1.1/24') ==
+ ipaddress.ip_interface('1.1.1.1/24'))
+ self.assertTrue(ipaddress.ip_interface('1.1.1.1/16') <
+ ipaddress.ip_interface('1.1.1.1/24'))
+ self.assertTrue(ipaddress.ip_interface('1.1.1.1/24') <
+ ipaddress.ip_interface('1.1.1.2/24'))
+ self.assertTrue(ipaddress.ip_interface('1.1.1.2/16') <
+ ipaddress.ip_interface('1.1.1.1/24'))
+ self.assertTrue(ipaddress.ip_interface('1.1.1.1/24') >
+ ipaddress.ip_interface('1.1.1.1/16'))
+ self.assertTrue(ipaddress.ip_interface('1.1.1.2/24') >
+ ipaddress.ip_interface('1.1.1.1/24'))
+ self.assertTrue(ipaddress.ip_interface('1.1.1.1/24') >
+ ipaddress.ip_interface('1.1.1.2/16'))
+
+ self.assertTrue(ipaddress.ip_interface('::1/64') ==
+ ipaddress.ip_interface('::1/64'))
+ self.assertTrue(ipaddress.ip_interface('::1/64') <
+ ipaddress.ip_interface('::1/80'))
+ self.assertTrue(ipaddress.ip_interface('::1/64') <
+ ipaddress.ip_interface('::2/64'))
+ self.assertTrue(ipaddress.ip_interface('::2/48') <
+ ipaddress.ip_interface('::1/64'))
+ self.assertTrue(ipaddress.ip_interface('::1/80') >
+ ipaddress.ip_interface('::1/64'))
+ self.assertTrue(ipaddress.ip_interface('::2/64') >
+ ipaddress.ip_interface('::1/64'))
+ self.assertTrue(ipaddress.ip_interface('::1/64') >
+ ipaddress.ip_interface('::2/48'))
def testNetworkComparison(self):
# ip1 and ip2 have the same network address