diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2012-05-26 14:25:58 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2012-05-26 14:25:58 (GMT) |
commit | 51c306755180a07559e931e3c7b1d1082b402b9c (patch) | |
tree | de0553ad74e3c0b9f01dd0f0d2aeee864dc63841 /Lib/test/test_ipaddress.py | |
parent | 072b1e1485e50b3698c9147ef6dd5b657c100978 (diff) | |
download | cpython-51c306755180a07559e931e3c7b1d1082b402b9c.zip cpython-51c306755180a07559e931e3c7b1d1082b402b9c.tar.gz cpython-51c306755180a07559e931e3c7b1d1082b402b9c.tar.bz2 |
Issue #14814: In the spirit of TOOWTDI, ditch the redundant version parameter to the factory functions by using the appropriate direct class references instead
Diffstat (limited to 'Lib/test/test_ipaddress.py')
-rw-r--r-- | Lib/test/test_ipaddress.py | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/Lib/test/test_ipaddress.py b/Lib/test/test_ipaddress.py index 6bf5174..bf5286b 100644 --- a/Lib/test/test_ipaddress.py +++ b/Lib/test/test_ipaddress.py @@ -780,12 +780,6 @@ class IpaddrUnitTest(unittest.TestCase): self.assertEqual(self.ipv4_address.version, 4) self.assertEqual(self.ipv6_address.version, 6) - with self.assertRaises(ValueError): - ipaddress.ip_address('1', version=[]) - - with self.assertRaises(ValueError): - ipaddress.ip_address('1', version=5) - def testMaxPrefixLength(self): self.assertEqual(self.ipv4_interface.max_prefixlen, 32) self.assertEqual(self.ipv6_interface.max_prefixlen, 128) @@ -1052,12 +1046,7 @@ class IpaddrUnitTest(unittest.TestCase): def testForceVersion(self): self.assertEqual(ipaddress.ip_network(1).version, 4) - self.assertEqual(ipaddress.ip_network(1, version=6).version, 6) - - with self.assertRaises(ValueError): - ipaddress.ip_network(1, version='l') - with self.assertRaises(ValueError): - ipaddress.ip_network(1, version=3) + self.assertEqual(ipaddress.IPv6Network(1).version, 6) def testWithStar(self): self.assertEqual(str(self.ipv4_interface.with_prefixlen), "1.2.3.4/24") @@ -1148,13 +1137,6 @@ class IpaddrUnitTest(unittest.TestCase): sixtofouraddr.sixtofour) self.assertFalse(bad_addr.sixtofour) - def testIpInterfaceVersion(self): - with self.assertRaises(ValueError): - ipaddress.ip_interface(1, version=123) - - with self.assertRaises(ValueError): - ipaddress.ip_interface(1, version='') - if __name__ == '__main__': unittest.main() |