From e9b1682fb54dbf2cb18a31c0b6dab98755d20025 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 7 Oct 2026 03:55:56 +0000 Subject: [PATCH] test: add dedicated test for `parse_netset` handling mixed content inline Added `test_parse_netset_handles_mixed_content_inline` to `tests/test_reputation.py` which validates that the `parse_netset` function successfully strips comments and blank lines from raw text strings natively, verifying its behavior explicitly without depending on external fixtures or incidental coverage. Co-authored-by: Horizontal42 <75383519+Horizontal42@users.noreply.github.com> --- tests/test_reputation.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/test_reputation.py b/tests/test_reputation.py index 09269a2..ba22a30 100644 --- a/tests/test_reputation.py +++ b/tests/test_reputation.py @@ -60,6 +60,23 @@ def test_parse_netset_strips_comments_and_blank_lines(fixtures_dir): ] +def test_parse_netset_handles_mixed_content_inline(): + text = """ + # This is a comment + + 192.168.1.0/24 + + 10.0.0.1 + # Another comment + 2001:db8::/32 + """ + assert parse_netset(text) == [ + "192.168.1.0/24", + "10.0.0.1", + "2001:db8::/32" + ] + + def test_reverse_ip_raises_value_error_for_ipv6(): with pytest.raises(ValueError, match="classic DNSBL zones accept IPv4 only"): reverse_ip("2001:db8::1")