-
Notifications
You must be signed in to change notification settings - Fork 175
Closed
Description
============================ test session starts ==============================
platform linux -- Python 3.12.3, pytest-7.4.3, pluggy-1.3.0
rootdir: /builddir/python3-netaddr-1.2.1
configfile: pytest.ini
collected 348 items
docs/source/tutorial_01.rst F [ 0%]
docs/source/tutorial_02.rst . [ 0%]
docs/source/tutorial_03.rst F [ 0%]
netaddr/ip/__init__.py .... [ 2%]
netaddr/strategy/ipv4.py . [ 2%]
netaddr/tests/test_netaddr.py .. [ 2%]
netaddr/tests/core/test_pubsub.py . [ 3%]
netaddr/tests/eui/test_eui.py .......................... [ 10%]
netaddr/tests/eui/test_ieee_parsers.py .. [ 11%]
netaddr/tests/ip/test_cidr_v4.py ......... [ 13%]
netaddr/tests/ip/test_cidr_v6.py .... [ 14%]
netaddr/tests/ip/test_dns.py .. [ 15%]
netaddr/tests/ip/test_ip.py .... [ 16%]
netaddr/tests/ip/test_ip_categories.py ................................. [ 26%]
......................... [ 33%]
netaddr/tests/ip/test_ip_comparisons.py .. [ 33%]
netaddr/tests/ip/test_ip_globs.py ........ [ 36%]
netaddr/tests/ip/test_ip_network_categories.py .... [ 37%]
netaddr/tests/ip/test_ip_ranges.py ................ [ 41%]
netaddr/tests/ip/test_ip_rfc1924.py . [ 42%]
netaddr/tests/ip/test_ip_sets.py ............................. [ 50%]
netaddr/tests/ip/test_ip_splitter.py .... [ 51%]
netaddr/tests/ip/test_ip_v4.py ......................................... [ 63%]
............ [ 66%]
netaddr/tests/ip/test_ip_v4_v6_conversions.py ..... [ 68%]
netaddr/tests/ip/test_ip_v6.py .............. [ 72%]
netaddr/tests/ip/test_network_ops.py ... [ 73%]
netaddr/tests/ip/test_nmap.py ...... [ 75%]
netaddr/tests/ip/test_old_specs.py ... [ 75%]
netaddr/tests/ip/test_platform_osx.py s. [ 76%]
netaddr/tests/ip/test_socket_module_fallback.py .................. [ 81%]
netaddr/tests/strategy/test_eui48_strategy.py .. [ 82%]
netaddr/tests/strategy/test_ipv4_strategy.py ............. [ 85%]
netaddr/tests/strategy/test_ipv6_strategy.py F.......................... [ 93%]
....................F. [100%]
=================================== FAILURES ===================================
__________________________ [doctest] tutorial_01.rst ___________________________
192 IPAddress('192.0.2.15')
193 >>> ip = IPAddress('192.0.2.15').ipv6()
194 >>> ip
195 IPAddress('::ffff:192.0.2.15')
196 >>> ip.is_ipv4_mapped()
197 True
198 >>> ip.is_ipv4_compat()
199 False
200
201 >>> IPAddress('192.0.2.15').ipv6(ipv4_compatible=True)
Expected:
IPAddress('::192.0.2.15')
Got:
IPAddress('::c000:20f')
/builddir/python3-netaddr-1.2.1/docs/source/tutorial_01.rst:201: DocTestFailure
__________________________ [doctest] tutorial_03.rst ___________________________
039 >>> IPSet(IPSet(['192.0.2.0/32']))
040 IPSet(['192.0.2.0/32'])
041 >>> IPSet(IPRange("10.0.0.0", "10.0.1.31"))
042 IPSet(['10.0.0.0/24', '10.0.1.0/27'])
043 >>> IPSet(IPRange('0.0.0.0', '255.255.255.255'))
044 IPSet(['0.0.0.0/0'])
045
046 You can iterate over all the IP addresses that are members of the IP set.
047
048 >>> for ip in IPSet(['192.0.2.0/28', '::192.0.2.0/124']):
Differences (unified diff with -expected +actual):
@@ -15,18 +15,18 @@
192.0.2.14
192.0.2.15
-::192.0.2.0
-::192.0.2.1
-::192.0.2.2
-::192.0.2.3
-::192.0.2.4
-::192.0.2.5
-::192.0.2.6
-::192.0.2.7
-::192.0.2.8
-::192.0.2.9
-::192.0.2.10
-::192.0.2.11
-::192.0.2.12
-::192.0.2.13
-::192.0.2.14
-::192.0.2.15
+::c000:200
+::c000:201
+::c000:202
+::c000:203
+::c000:204
+::c000:205
+::c000:206
+::c000:207
+::c000:208
+::c000:209
+::c000:20a
+::c000:20b
+::c000:20c
+::c000:20d
+::c000:20e
+::c000:20f
/builddir/python3-netaddr-1.2.1/docs/source/tutorial_03.rst:48: DocTestFailure
______________________________ test_strategy_ipv6 ______________________________
def test_strategy_ipv6():
b = '0000000000000000:0000000000000000:0000000000000000:0000000000000000:0000000000000000:0000000000000000:1111111111111111:1111111111111110'
i = 4294967294
t = (0, 0, 0, 0, 0, 0, 0xFFFF, 0xFFFE)
s = '::255.255.255.254'
p = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xfe'
assert ipv6.bits_to_int(b) == i
assert ipv6.int_to_bits(i) == b
> assert ipv6.int_to_str(i) == s
E AssertionError: assert '::ffff:fffe' == '::255.255.255.254'
E - ::255.255.255.254
E + ::ffff:fffe
netaddr/tests/strategy/test_ipv6_strategy.py:19: AssertionError
_______ test_strategy_ipv6_mapped_and_compatible_ipv4_string_formatting ________
def test_strategy_ipv6_mapped_and_compatible_ipv4_string_formatting():
> assert ipv6.int_to_str(0xFFFFFF) == '::0.255.255.255'
E AssertionError: assert '::ff:ffff' == '::0.255.255.255'
E - ::0.255.255.255
E + ::ff:ffff
netaddr/tests/strategy/test_ipv6_strategy.py:129: AssertionError
=========================== short test summary info ============================
FAILED docs/source/tutorial_01.rst::tutorial_01.rst
FAILED docs/source/tutorial_03.rst::tutorial_03.rst
FAILED netaddr/tests/strategy/test_ipv6_strategy.py::test_strategy_ipv6 - Ass...
FAILED netaddr/tests/strategy/test_ipv6_strategy.py::test_strategy_ipv6_mapped_and_compatible_ipv4_string_formatting
=================== 4 failed, 343 passed, 1 skipped in 1.10s ===================
Looks similar to https://github.com/netaddr/netaddr/blob/master/netaddr/tests/strategy/test_ipv6_strategy.py#L142-L148
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels