diff options
Diffstat (limited to 'Lib/test')
-rwxr-xr-x | Lib/test/test_ipaddr.py | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/Lib/test/test_ipaddr.py b/Lib/test/test_ipaddr.py index 46b9cab6a9..efae07a33a 100755 --- a/Lib/test/test_ipaddr.py +++ b/Lib/test/test_ipaddr.py @@ -1,18 +1,6 @@ # Copyright 2007 Google Inc. # Licensed to PSF under a Contributor Agreement. # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# # See also: http://code.google.com/p/ipaddr-py/ """Unittest for ipaddr module.""" @@ -373,6 +361,21 @@ class IpaddrUnitTest(unittest.TestCase): self.assertTrue(ipv6 > ipv4) self.assertTrue(ipv4 < ipv6) + # Regression test for issue6169 (ipaddr-py issue 19) + ip1 = ipaddr.IP('10.1.2.128/25') + self.assertFalse(ip1 < ip1) + self.assertFalse(ip1 > ip1) + ip2 = ipaddr.IP('10.1.3.0/24') + self.assertTrue(ip1 < ip2) + self.assertFalse(ip2 < ip1) + self.assertFalse(ip1 > ip2) + self.assertTrue(ip2 > ip1) + ip3 = ipaddr.IP('10.1.3.0/25') + self.assertTrue(ip2 < ip3) + self.assertFalse(ip3 < ip2) + self.assertFalse(ip2 > ip3) + self.assertTrue(ip3 > ip2) + def test_embedded_ipv4(self): ipv4_string = '192.168.0.1' ipv4 = ipaddr.IPv4(ipv4_string) |