Skip to content

Commit

Permalink
bpo-43633 Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Olexandr Pavlyuk committed Jan 5, 2022
1 parent 9f4bbaf commit ec15df5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Lib/test/test_ipaddress.py
Original file line number Diff line number Diff line change
Expand Up @@ -1298,14 +1298,14 @@ def testGetIp(self):
'2001:658:22a:cafe:200::1')

def testIPv6IPv4MappedStringRepresentation(self):
long_prefix_len = 30
prefix = '::ffff:'
long_prefix = '0000:0000:0000:0000:0000:ffff:'
short_prefix = '::ffff:'
ipv4 = '1.2.3.4'
ipv6_ipv4_mapped_str = '%s%s' % (prefix, ipv4)
ipv6_ipv4_mapped_str = '%s%s' % (short_prefix, ipv4)
ipv6_ipv4_mapped_address = ipaddress.IPv6Address(ipv6_ipv4_mapped_str)
ipv6_ipv4_mapped_interface = ipaddress.IPv6Interface(ipv6_ipv4_mapped_str)
self.assertEqual(str(ipv6_ipv4_mapped_address), ipv6_ipv4_mapped_str)
self.assertEqual(ipv6_ipv4_mapped_address.exploded, ipv6_ipv4_mapped_str.exploded[long_prefix_len] + ipv4)
self.assertEqual(ipv6_ipv4_mapped_address.exploded, long_prefix + ipv4)
self.assertEqual(str(ipv6_ipv4_mapped_interface.ip), ipv6_ipv4_mapped_str)

def testGetScopeId(self):
Expand Down

0 comments on commit ec15df5

Please sign in to comment.