/usr/lib/rads/venv/lib/python3.13/site-packages/netaddr/tests/ip
NameSizeModeActions
__pycache__/-0755rm
test_cidr_v4.py75740644editdlrm
test_cidr_v6.py46730644editdlrm
test_dns.py3200644editdlrm
test_ip.py6250644editdlrm
test_ip_categories.py41400644editdlrm
test_ip_comparisons.py14190644editdlrm
test_ip_globs.py21410644editdlrm
test_ip_network_categories.py5470644editdlrm
test_ip_ranges.py87780644editdlrm
test_ip_rfc1924.py5120644editdlrm
test_ip_sets.py232220644editdlrm
test_ip_splitter.py22680644editdlrm
test_ip_v4.py154310644editdlrm
test_ip_v4_v6_conversions.py12480644editdlrm
test_ip_v6.py60970644editdlrm
test_network_ops.py24220644editdlrm
test_nmap.py37100644editdlrm
test_old_specs.py65270644editdlrm
test_platform_osx.py54190644editdlrm
test_socket_module_fallback.py15140644editdlrm
__init__.py00644editdlrm
Edit: /usr/lib/rads/venv/lib/python3.13/site-packages/netaddr/tests/ip/test_platform_osx.py (5419B)
import platform import pytest from netaddr import iprange_to_cidrs, IPNetwork from netaddr.strategy.ipv6 import int_to_str @pytest.mark.skipif('sys.platform != "darwin"') def test_ip_behaviour_osx(): assert iprange_to_cidrs('::1', '::255.255.255.254') == [ IPNetwork('::1/128'), IPNetwork('::0.0.0.2/127'), IPNetwork('::0.0.0.4/126'), IPNetwork('::0.0.0.8/125'), IPNetwork('::0.0.0.16/124'), IPNetwork('::0.0.0.32/123'), IPNetwork('::0.0.0.64/122'), IPNetwork('::0.0.0.128/121'), IPNetwork('::0.0.1.0/120'), IPNetwork('::0.0.2.0/119'), IPNetwork('::0.0.4.0/118'), IPNetwork('::0.0.8.0/117'), IPNetwork('::0.0.16.0/116'), IPNetwork('::0.0.32.0/115'), IPNetwork('::0.0.64.0/114'), IPNetwork('::0.0.128.0/113'), IPNetwork('::0.1.0.0/112'), IPNetwork('::0.2.0.0/111'), IPNetwork('::0.4.0.0/110'), IPNetwork('::0.8.0.0/109'), IPNetwork('::0.16.0.0/108'), IPNetwork('::0.32.0.0/107'), IPNetwork('::0.64.0.0/106'), IPNetwork('::0.128.0.0/105'), IPNetwork('::1.0.0.0/104'), IPNetwork('::2.0.0.0/103'), IPNetwork('::4.0.0.0/102'), IPNetwork('::8.0.0.0/101'), IPNetwork('::16.0.0.0/100'), IPNetwork('::32.0.0.0/99'), IPNetwork('::64.0.0.0/98'), IPNetwork('::128.0.0.0/98'), IPNetwork('::192.0.0.0/99'), IPNetwork('::224.0.0.0/100'), IPNetwork('::240.0.0.0/101'), IPNetwork('::248.0.0.0/102'), IPNetwork('::252.0.0.0/103'), IPNetwork('::254.0.0.0/104'), IPNetwork('::255.0.0.0/105'), IPNetwork('::255.128.0.0/106'), IPNetwork('::255.192.0.0/107'), IPNetwork('::255.224.0.0/108'), IPNetwork('::255.240.0.0/109'), IPNetwork('::255.248.0.0/110'), IPNetwork('::255.252.0.0/111'), IPNetwork('::255.254.0.0/112'), IPNetwork('::255.255.0.0/113'), IPNetwork('::255.255.128.0/114'), IPNetwork('::255.255.192.0/115'), IPNetwork('::255.255.224.0/116'), IPNetwork('::255.255.240.0/117'), IPNetwork('::255.255.248.0/118'), IPNetwork('::255.255.252.0/119'), IPNetwork('::255.255.254.0/120'), IPNetwork('::255.255.255.0/121'), IPNetwork('::255.255.255.128/122'), IPNetwork('::255.255.255.192/123'), IPNetwork('::255.255.255.224/124'), IPNetwork('::255.255.255.240/125'), IPNetwork('::255.255.255.248/126'), IPNetwork('::255.255.255.252/127'), IPNetwork('::255.255.255.254/128'), ] # At least Apple changed inet_ntop in Mac OS 10.15 (Catalina) so it's compatible with Linux if platform.mac_ver()[0] >= '10.15': assert int_to_str(0xFFFF) == '::ffff' else: assert int_to_str(0xFFFF) == '::0.0.255.255' @pytest.mark.skipif('sys.platform == "darwin"') def test_ip_behaviour_non_osx(): assert iprange_to_cidrs('::1', '::255.255.255.254') == [ IPNetwork('::1/128'), IPNetwork('::2/127'), IPNetwork('::4/126'), IPNetwork('::8/125'), IPNetwork('::10/124'), IPNetwork('::20/123'), IPNetwork('::40/122'), IPNetwork('::80/121'), IPNetwork('::100/120'), IPNetwork('::200/119'), IPNetwork('::400/118'), IPNetwork('::800/117'), IPNetwork('::1000/116'), IPNetwork('::2000/115'), IPNetwork('::4000/114'), IPNetwork('::8000/113'), IPNetwork('::0.1.0.0/112'), IPNetwork('::0.2.0.0/111'), IPNetwork('::0.4.0.0/110'), IPNetwork('::0.8.0.0/109'), IPNetwork('::0.16.0.0/108'), IPNetwork('::0.32.0.0/107'), IPNetwork('::0.64.0.0/106'), IPNetwork('::0.128.0.0/105'), IPNetwork('::1.0.0.0/104'), IPNetwork('::2.0.0.0/103'), IPNetwork('::4.0.0.0/102'), IPNetwork('::8.0.0.0/101'), IPNetwork('::16.0.0.0/100'), IPNetwork('::32.0.0.0/99'), IPNetwork('::64.0.0.0/98'), IPNetwork('::128.0.0.0/98'), IPNetwork('::192.0.0.0/99'), IPNetwork('::224.0.0.0/100'), IPNetwork('::240.0.0.0/101'), IPNetwork('::248.0.0.0/102'), IPNetwork('::252.0.0.0/103'), IPNetwork('::254.0.0.0/104'), IPNetwork('::255.0.0.0/105'), IPNetwork('::255.128.0.0/106'), IPNetwork('::255.192.0.0/107'), IPNetwork('::255.224.0.0/108'), IPNetwork('::255.240.0.0/109'), IPNetwork('::255.248.0.0/110'), IPNetwork('::255.252.0.0/111'), IPNetwork('::255.254.0.0/112'), IPNetwork('::255.255.0.0/113'), IPNetwork('::255.255.128.0/114'), IPNetwork('::255.255.192.0/115'), IPNetwork('::255.255.224.0/116'), IPNetwork('::255.255.240.0/117'), IPNetwork('::255.255.248.0/118'), IPNetwork('::255.255.252.0/119'), IPNetwork('::255.255.254.0/120'), IPNetwork('::255.255.255.0/121'), IPNetwork('::255.255.255.128/122'), IPNetwork('::255.255.255.192/123'), IPNetwork('::255.255.255.224/124'), IPNetwork('::255.255.255.240/125'), IPNetwork('::255.255.255.248/126'), IPNetwork('::255.255.255.252/127'), IPNetwork('::255.255.255.254/128'), ] assert int_to_str(0xFFFF) == '::ffff'