File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -1298,10 +1298,14 @@ def testGetIp(self):
1298
1298
'2001:658:22a:cafe:200::1' )
1299
1299
1300
1300
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 )
1302
1305
ipv6_ipv4_mapped_address = ipaddress .IPv6Address (ipv6_ipv4_mapped_str )
1303
1306
ipv6_ipv4_mapped_interface = ipaddress .IPv6Interface (ipv6_ipv4_mapped_str )
1304
1307
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 )
1305
1309
self .assertEqual (str (ipv6_ipv4_mapped_interface .ip ), ipv6_ipv4_mapped_str )
1306
1310
1307
1311
def testGetScopeId (self ):
You can’t perform that action at this time.
0 commit comments