Skip to content

Commit f3642ca

Browse files
committed
bpo-43633 Update tests
1 parent 118e335 commit f3642ca

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Lib/test/test_ipaddress.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1298,10 +1298,14 @@ def testGetIp(self):
12981298
'2001:658:22a:cafe:200::1')
12991299

13001300
def testIPv6IPv4MappedStringRepresentation(self):
1301-
ipv6_ipv4_mapped_str = '::ffff:1.2.3.4'
1301+
long_prefix_len = 30
1302+
prefix = '::ffff:'
1303+
ipv4 = '1.2.3.4'
1304+
ipv6_ipv4_mapped_str = '%s%s' % (prefix, ipv4)
13021305
ipv6_ipv4_mapped_address = ipaddress.IPv6Address(ipv6_ipv4_mapped_str)
13031306
ipv6_ipv4_mapped_interface = ipaddress.IPv6Interface(ipv6_ipv4_mapped_str)
13041307
self.assertEqual(str(ipv6_ipv4_mapped_address), ipv6_ipv4_mapped_str)
1308+
self.assertEqual(ipv6_ipv4_mapped_address.exploded, ipv6_ipv4_mapped_str.exploded[long_prefix_len] + ipv4)
13051309
self.assertEqual(str(ipv6_ipv4_mapped_interface.ip), ipv6_ipv4_mapped_str)
13061310

13071311
def testGetScopeId(self):

0 commit comments

Comments
 (0)