__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
from netaddr import IPAddress, IPNetwork
def test_ip_v4_to_ipv6_mapped():
ip = IPAddress('192.0.2.15').ipv6()
assert ip == IPAddress('::ffff:192.0.2.15')
assert ip.is_ipv4_mapped()
assert not ip.is_ipv4_compat()
def test_ip_v4_to_ipv4():
assert IPAddress('192.0.2.15').ipv4() == IPAddress('192.0.2.15')
def test_ip_v4_to_ipv6_compatible():
assert IPAddress('192.0.2.15').ipv6(ipv4_compatible=True) == IPAddress('::192.0.2.15')
assert IPAddress('192.0.2.15').ipv6(ipv4_compatible=True).is_ipv4_compat()
assert IPAddress('192.0.2.15').ipv6(True) == IPAddress('::192.0.2.15')
ip = IPNetwork('192.0.2.1/23')
assert ip.ipv4() == IPNetwork('192.0.2.1/23')
assert ip.ipv6() == IPNetwork('::ffff:192.0.2.1/119')
assert ip.ipv6(ipv4_compatible=True) == IPNetwork('::192.0.2.1/119')
def test_ip_v6_to_ipv4():
assert IPNetwork('::ffff:192.0.2.1/119').ipv6(ipv4_compatible=True) == IPNetwork(
'::192.0.2.1/119'
)
assert IPNetwork('::ffff:192.0.2.1/119').ipv4() == IPNetwork('192.0.2.1/23')
assert IPNetwork('::192.0.2.1/119').ipv4() == IPNetwork('192.0.2.1/23')
def test_ip_v6_to_ipv6():
assert IPNetwork('::ffff:192.0.2.1/119').ipv6() == IPNetwork('::ffff:192.0.2.1/119')
| 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 |
|