Commit graph

13 commits

Author SHA1 Message Date
Horizontal42
fb28b0ac37
🧪 Add tests for check_fresh in reputation.py (#9)
* 🧪 Add tests for check_fresh and improve coverage in reputation.py

* Extract `check_fresh` to a module-level function for testability.
* Add comprehensive tests for `check_fresh` covering missing, fresh, and stale cache files.
* Add a missing test for `reverse_ip` with IPv6 to hit 100% coverage on `reputation.py`.

Co-authored-by: Horizontal42 <75383519+Horizontal42@users.noreply.github.com>

* drop redundant pytest-cov dep addition

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-08-19 17:09:13 +03:00
Andrew Pimenov
89a667b666 test: cover firehol dir creation in refresh_netsets 2026-08-19 16:42:00 +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
19c06279fe add test coverage for fetch_internetdb 2026-08-09 16:19:59 +03:00
Andrew Pimenov
d5b8d27bfd add test coverage for fetch_abuseipdb 2026-08-09 16:18:46 +03:00
Andrew Pimenov
1554af5943 add tests for summarize_dnsbl 2026-08-09 16:17:35 +03:00
Andrew Pimenov
bc5b01ae58 add test coverage for refresh_netsets 2026-08-09 16:16:32 +03:00
Andrew Pimenov
be99c19cfd add async tests for query_dnsbl 2026-08-09 16:13:42 +03:00
Andrew Pimenov
4c290ec309 refactor build_reputation to use ReputationContext dataclass 2026-08-09 16:08:29 +03:00
Andrew Pimenov
483989c1bc rename package netcheck to netsleuth (name taken on pypi) 2026-08-09 11:43:00 +03:00
Andrew Pimenov
9e5ea923aa reputation: russian rationale alongside english 2026-08-09 04:10:08 +03:00
Andrew Pimenov
d7b4c49786 reputation: internetdb, captcha risk and reputation assembly 2026-08-09 02:21:57 +03:00
Andrew Pimenov
48f7865987 reputation: firehol netset cache with local range index 2026-08-09 02:19:43 +03:00