mirror of
https://github.com/Horizontal42/netsleuth.git
synced 2026-11-10 20:22:03 +03:00
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:
parent
8c99ac78b7
commit
e9b1682fb5
1 changed files with 17 additions and 0 deletions
|
|
@ -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")
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue