diff options
author | Peter Moody <pmoody@google.com> | 2009-10-30 18:01:41 +0000 |
---|---|---|
committer | Peter Moody <pmoody@google.com> | 2009-10-30 18:01:41 +0000 |
commit | 237226b16f8d95cdb011a1a7dd1b4f11d39848d1 (patch) | |
tree | ef6dcc5a5b3bc97114f0a21392e48d115d22953b /ipaddr_test.py | |
parent | 119c74f27bf3d41886d3bda1d7beb81f33d2ea65 (diff) | |
download | ipaddr-py-237226b16f8d95cdb011a1a7dd1b4f11d39848d1.tar.gz |
+ require that address or network objects be passed into __contains__ and
overlaps (as opposed to also accepting strings/ints). more consistent
interface. easier to maintain, etc. Suggestion from Phillip.
git-svn-id: https://ipaddr-py.googlecode.com/svn/trunk@122 09200d28-7f98-11dd-ad27-0f66e57d2035
Diffstat (limited to 'ipaddr_test.py')
-rwxr-xr-x | ipaddr_test.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/ipaddr_test.py b/ipaddr_test.py index dfb1c9b..9346b72 100755 --- a/ipaddr_test.py +++ b/ipaddr_test.py @@ -297,11 +297,8 @@ class IpaddrUnitTest(unittest.TestCase): self.assertTrue(self.ipv4 in self.ipv4) self.assertTrue(self.ipv6 in self.ipv6) # We can test addresses and string as well. - addr1str = '1.2.3.37' - addr1 = ipaddr.IPv4Address(addr1str) + addr1 = ipaddr.IPv4Address('1.2.3.37') self.assertTrue(addr1 in self.ipv4) - self.assertTrue(int(addr1) in self.ipv4) - self.assertTrue(addr1str in self.ipv4) def testBadAddress(self): self.assertRaises(ipaddr.IPv4IpValidationError, ipaddr.IPv4Network, @@ -571,7 +568,6 @@ class IpaddrUnitTest(unittest.TestCase): self.assertTrue(self.ipv4.overlaps(other)) self.assertFalse(self.ipv4.overlaps(other2)) self.assertTrue(other2.overlaps(other3)) - self.assertTrue(other2.overlaps('1.2.2.64/26')) def testEmbeddedIpv4(self): ipv4_string = '192.168.0.1' |