This commit adds tests to ensure `ValueError` exception paths
in `ip_geo.py` are properly covered, specifically for `_ip_version`
and the ripestat HTTP JSON parsing fallback.
Coverage for `ip_geo.py` is now at 100%.
Co-authored-by: Horizontal42 <75383519+Horizontal42@users.noreply.github.com>
This commit adds a new test file, `tests/test_cli.py`, containing
unit tests for the `_os_timezone` function in `netsleuth.cli`.
The tests cover:
- Happy paths (TZ variable, /etc/localtime symlink, /etc/timezone file)
- The edge case of an `OSError` exception being thrown when reading the
/etc/timezone file.
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
cf-trace has no way to describe an arbitrary target — it always
echoes the ip of whoever is making the http request. gather_identity
included it in the merge candidates unconditionally, so 'netcheck
--target 8.8.8.8' spliced this machine's own connecting ip onto
8.8.8.8's asn/city/org fields from the other providers, producing a
report that named an ip that was neither the target nor honestly
labeled as the local egress. exclude cf-trace from the merge whenever
an explicit target ip was requested; it's still fetched and returned
separately for the connection section's own colo/warp fields.