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>
This commit is contained in:
google-labs-jules[bot] 2026-10-07 03:55:56 +00:00
parent 8c99ac78b7
commit e9b1682fb5

View file

@ -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(): def test_reverse_ip_raises_value_error_for_ipv6():
with pytest.raises(ValueError, match="classic DNSBL zones accept IPv4 only"): with pytest.raises(ValueError, match="classic DNSBL zones accept IPv4 only"):
reverse_ip("2001:db8::1") reverse_ip("2001:db8::1")