Commit graph

9 commits

Author SHA1 Message Date
google-labs-jules[bot]
b4f2dad2be test: add tests for ValueError handling in ip_geo.py
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>
2026-08-19 17:41:52 +03:00
Horizontal42
44ca9c1786
Add tests for _os_timezone function (#22)
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>
2026-08-19 16:40:44 +03:00
Andrew Pimenov
053e42c811 expand classify_ip_type test coverage 2026-08-09 16:17:49 +03:00
Andrew Pimenov
0be881b96a add tests for merge_geo edge cases and improve ip_geo coverage 2026-08-09 16:16:47 +03:00
Andrew Pimenov
483989c1bc rename package netcheck to netsleuth (name taken on pypi) 2026-08-09 11:43:00 +03:00
Andrew Pimenov
168cd14f51 ip_geo: russian dual-stack mismatch note alongside english 2026-08-09 11:27:20 +03:00
Andrew Pimenov
5da12ae629 ip_geo: never let cf-trace's own ip leak into a target lookup
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.
2026-08-09 03:52:25 +03:00
Andrew Pimenov
db055d8a85 ip_geo: field-wise merge, dual-stack comparison, provider fan-out 2026-08-09 02:14:03 +03:00
Andrew Pimenov
858806f014 ip_geo: per-provider normalizers to a common IpGeo shape 2026-08-09 02:12:56 +03:00