summaryrefslogtreecommitdiff
path: root/branches/2.1.x
diff options
context:
space:
mode:
authorpmoody@google.com <pmoody@google.com@09200d28-7f98-11dd-ad27-0f66e57d2035>2010-06-13 00:24:17 +0000
committerpmoody@google.com <pmoody@google.com@09200d28-7f98-11dd-ad27-0f66e57d2035>2010-06-13 00:24:17 +0000
commitbe2fc2bb656c54925329a346957472e96170c778 (patch)
tree81856912b0cd94eb76c9992ac8f1a044192c356b /branches/2.1.x
parent7f24fc4e74ddb514e9356da7ab0547f19b039d00 (diff)
downloadipaddr-py-be2fc2bb656c54925329a346957472e96170c778.tar.gz
+ quick bug fix (issue61).
+ also starting to include release notes with the release per request from Scott. git-svn-id: https://ipaddr-py.googlecode.com/svn@173 09200d28-7f98-11dd-ad27-0f66e57d2035
Diffstat (limited to 'branches/2.1.x')
-rw-r--r--branches/2.1.x/ipaddr.py6
-rwxr-xr-xbranches/2.1.x/ipaddr_test.py6
2 files changed, 7 insertions, 5 deletions
diff --git a/branches/2.1.x/ipaddr.py b/branches/2.1.x/ipaddr.py
index 6cadbf1..ad8471c 100644
--- a/branches/2.1.x/ipaddr.py
+++ b/branches/2.1.x/ipaddr.py
@@ -22,7 +22,7 @@ and networks.
"""
-__version__ = '2.1.2'
+__version__ = '2.1.3'
import struct
@@ -593,8 +593,8 @@ class _BaseNet(_IPAddrBase):
def __contains__(self, other):
# dealing with another network.
if isinstance(other, _BaseNet):
- return (int(self.network) <= int(other._ip) and
- int(self.broadcast) >= int(other.broadcast))
+ return (self.network <= other.network and
+ self.broadcast >= other.broadcast)
# dealing with another address
else:
return (int(self.network) <= int(other._ip) <=
diff --git a/branches/2.1.x/ipaddr_test.py b/branches/2.1.x/ipaddr_test.py
index 37880aa..61ac4b0 100755
--- a/branches/2.1.x/ipaddr_test.py
+++ b/branches/2.1.x/ipaddr_test.py
@@ -351,13 +351,15 @@ class IpaddrUnitTest(unittest.TestCase):
def testContains(self):
self.assertTrue(ipaddr.IPv4Network('1.2.3.128/25') in self.ipv4)
self.assertFalse(ipaddr.IPv4Network('1.2.4.1/24') in self.ipv4)
- self.assertFalse(self.ipv4 in self.ipv6)
- self.assertFalse(self.ipv6 in self.ipv4)
self.assertTrue(self.ipv4 in self.ipv4)
self.assertTrue(self.ipv6 in self.ipv6)
# We can test addresses and string as well.
addr1 = ipaddr.IPv4Address('1.2.3.37')
self.assertTrue(addr1 in self.ipv4)
+ # issue 61, bad network comparison on like-ip'd network objects
+ # with identical broadcast addresses.
+ self.assertFalse(ipaddr.IPv4Network('1.1.0.0/16').__contains__(
+ ipaddr.IPv4Network('1.0.0.0/15')))
def testBadAddress(self):
self.assertRaises(ipaddr.AddressValueError, ipaddr.IPv4Network,