__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
import pytest
from netaddr.fbsocket import inet_ntop, inet_pton, inet_ntoa, AF_INET, AF_INET6
@pytest.mark.parametrize(
('actual', 'expected'),
[
('0:0:0:0:0:0:0:0', '::'),
('0:0:0:0:0:0:0:A', '::a'),
('A:0:0:0:0:0:0:0', 'a::'),
('A:0:A:0:0:0:0:0', 'a:0:a::'),
('A:0:0:0:0:0:0:A', 'a::a'),
('0:A:0:0:0:0:0:A', '0:a::a'),
('A:0:A:0:0:0:0:A', 'a:0:a::a'),
('0:0:0:A:0:0:0:A', '::a:0:0:0:a'),
('0:0:0:0:A:0:0:A', '::a:0:0:a'),
('A:0:0:0:0:A:0:A', 'a::a:0:a'),
('A:0:0:A:0:0:A:0', 'a::a:0:0:a:0'),
('A:0:A:0:A:0:A:0', 'a:0:a:0:a:0:a:0'),
('0:A:0:A:0:A:0:A', '0:a:0:a:0:a:0:a'),
('1080:0:0:0:8:800:200C:417A', '1080::8:800:200c:417a'),
('FEDC:BA98:7654:3210:FEDC:BA98:7654:3210', 'fedc:ba98:7654:3210:fedc:ba98:7654:3210'),
],
)
def test_inet_ntop_and_inet_pton_ipv6_conversion(actual, expected):
assert inet_ntop(AF_INET6, inet_pton(AF_INET6, actual)) == expected
def test_inet_ntoa_ipv4_exceptions():
with pytest.raises(TypeError):
inet_ntoa(1)
with pytest.raises(ValueError):
inet_ntoa('\x00')
def test_inet_pton_ipv4_exceptions():
with pytest.raises(OSError):
inet_pton(AF_INET, '::0x07f')
with pytest.raises(TypeError):
inet_pton(AF_INET, 1)
def test_inet_pton_ipv6_exceptions():
with pytest.raises(OSError):
inet_pton(AF_INET6, '::0x07f')
with pytest.raises(TypeError):
inet_pton(AF_INET6, 1)
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| __pycache__ | Folder | 0755 |
|
|
| __init__.py | File | 0 B | 0644 |
|
| test_cidr_v4.py | File | 7.4 KB | 0644 |
|
| test_cidr_v6.py | File | 4.56 KB | 0644 |
|
| test_dns.py | File | 320 B | 0644 |
|
| test_ip.py | File | 625 B | 0644 |
|
| test_ip_categories.py | File | 4.04 KB | 0644 |
|
| test_ip_comparisons.py | File | 1.39 KB | 0644 |
|
| test_ip_globs.py | File | 2.09 KB | 0644 |
|
| test_ip_network_categories.py | File | 547 B | 0644 |
|
| test_ip_ranges.py | File | 8.57 KB | 0644 |
|
| test_ip_rfc1924.py | File | 512 B | 0644 |
|
| test_ip_sets.py | File | 22.68 KB | 0644 |
|
| test_ip_splitter.py | File | 2.21 KB | 0644 |
|
| test_ip_v4.py | File | 15.07 KB | 0644 |
|
| test_ip_v4_v6_conversions.py | File | 1.22 KB | 0644 |
|
| test_ip_v6.py | File | 5.95 KB | 0644 |
|
| test_network_ops.py | File | 2.37 KB | 0644 |
|
| test_nmap.py | File | 3.62 KB | 0644 |
|
| test_old_specs.py | File | 6.37 KB | 0644 |
|
| test_platform_osx.py | File | 5.29 KB | 0644 |
|
| test_socket_module_fallback.py | File | 1.48 KB | 0644 |
|