https://github.com/python/cpython/commit/d922aa80fd2569db0e473cb570ac52465299a6fe commit: d922aa80fd2569db0e473cb570ac52465299a6fe branch: 3.12 author: Miss Islington (bot) <31488909+miss-isling...@users.noreply.github.com> committer: encukou <encu...@gmail.com> date: 2025-02-28T12:41:34+01:00 summary:
[3.12] gh-130607: Extend and cleanup IPv6 tests (GH-121518) (GH-130678) Extend IPv6 tests and made little syntax refactoring (cherry picked from commit 9f0879baf15fdcf89f1b85cc244d596d4d0f4e47) Co-authored-by: Ilya Bazhenov <31971067+baz...@users.noreply.github.com> files: M Lib/test/test_ipaddress.py diff --git a/Lib/test/test_ipaddress.py b/Lib/test/test_ipaddress.py index 3c8a928b91cd7d..593a8b07c31475 100644 --- a/Lib/test/test_ipaddress.py +++ b/Lib/test/test_ipaddress.py @@ -886,8 +886,8 @@ class ComparisonTests(unittest.TestCase): v6net = ipaddress.IPv6Network(1) v6intf = ipaddress.IPv6Interface(1) v6addr_scoped = ipaddress.IPv6Address('::1%scope') - v6net_scoped= ipaddress.IPv6Network('::1%scope') - v6intf_scoped= ipaddress.IPv6Interface('::1%scope') + v6net_scoped = ipaddress.IPv6Network('::1%scope') + v6intf_scoped = ipaddress.IPv6Interface('::1%scope') v4_addresses = [v4addr, v4intf] v4_objects = v4_addresses + [v4net] @@ -1075,6 +1075,7 @@ def setUp(self): self.ipv6_scoped_interface = ipaddress.IPv6Interface( '2001:658:22a:cafe:200:0:0:1%scope/64') self.ipv6_scoped_network = ipaddress.IPv6Network('2001:658:22a:cafe::%scope/64') + self.ipv6_with_ipv4_part = ipaddress.IPv6Interface('::1.2.3.4') def testRepr(self): self.assertEqual("IPv4Interface('1.2.3.4/32')", @@ -1694,6 +1695,8 @@ def testEqual(self): self.assertTrue(self.ipv6_scoped_interface == ipaddress.IPv6Interface('2001:658:22a:cafe:200::1%scope/64')) + self.assertTrue(self.ipv6_with_ipv4_part == + ipaddress.IPv6Interface('0000:0000:0000:0000:0000:0000:0102:0304')) self.assertFalse(self.ipv6_scoped_interface == ipaddress.IPv6Interface('2001:658:22a:cafe:200::1%scope/63')) self.assertFalse(self.ipv6_scoped_interface == @@ -2173,6 +2176,7 @@ def testIPVersion(self): self.assertEqual(self.ipv4_address.version, 4) self.assertEqual(self.ipv6_address.version, 6) self.assertEqual(self.ipv6_scoped_address.version, 6) + self.assertEqual(self.ipv6_with_ipv4_part.version, 6) def testMaxPrefixLength(self): self.assertEqual(self.ipv4_interface.max_prefixlen, 32) _______________________________________________ Python-checkins mailing list -- python-checkins@python.org To unsubscribe send an email to python-checkins-le...@python.org https://mail.python.org/mailman3/lists/python-checkins.python.org/ Member address: arch...@mail-archive.com