mirror of
https://github.com/Horizontal42/netsleuth.git
synced 2026-11-11 01:02:10 +03:00
🧪 Add error test for ValueError in ip_geo.py (#10)
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
This commit is contained in:
parent
d0b4451c40
commit
be2e844c6d
1 changed files with 7 additions and 0 deletions
|
|
@ -34,6 +34,13 @@ def test_nat64_prefix_from_aaaa_handles_empty_and_garbage_input():
|
|||
assert nat64_prefix_from_aaaa(["not-an-address"]) is None
|
||||
|
||||
|
||||
def test_nat64_prefix_from_aaaa_value_error():
|
||||
from unittest.mock import patch
|
||||
|
||||
with patch("netsleuth.ip_geo.ipaddress.IPv6Address", side_effect=ValueError("mocked error")):
|
||||
assert nat64_prefix_from_aaaa(["2001:db8::1"]) is None
|
||||
|
||||
|
||||
def test_cgnat_findings_fires_on_local_ip_evidence():
|
||||
local = LocalNet(local_ipv4="100.64.5.5", cgnat=True, cgnat_evidence="local address 100.64.5.5 is in 100.64.0.0/10")
|
||||
findings = cgnat_findings(local, [])
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue