aboutsummaryrefslogtreecommitdiff
path: root/tests/models/network/test_nmap_parser.py
diff options
context:
space:
mode:
authorMax Nanis2026-08-26 16:46:45 -0700
committerMax Nanis2026-08-26 16:46:45 -0700
commitcf239865ce440e1a71ee2360514eaeb018620ac9 (patch)
tree1fefff4a0bbf10df6431e541aa5a3ff5e76f0663 /tests/models/network/test_nmap_parser.py
parent47ea200eac0eaa7bef02f6ebb05de9afad5ee0d7 (diff)
downloadgeneralresearch-cf239865ce440e1a71ee2360514eaeb018620ac9.tar.gz
generalresearch-cf239865ce440e1a71ee2360514eaeb018620ac9.zip
Ruff afternoon!
Diffstat (limited to 'tests/models/network/test_nmap_parser.py')
-rw-r--r--tests/models/network/test_nmap_parser.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/models/network/test_nmap_parser.py b/tests/models/network/test_nmap_parser.py
index 7822380..473a63f 100644
--- a/tests/models/network/test_nmap_parser.py
+++ b/tests/models/network/test_nmap_parser.py
@@ -1,8 +1,14 @@
+from __future__ import annotations
+
import os
import pytest
from generalresearch.models.network.nmap.parser import parse_nmap_xml
+from generalresearch.models.network.nmap.result import (
+ NmapResult,
+ NmapTrace,
+)
@pytest.fixture
@@ -13,9 +19,11 @@ def nmap_raw_output_2(request) -> str:
return data
-def test_nmap_xml_parser(nmap_raw_output, nmap_raw_output_2):
- n = parse_nmap_xml(nmap_raw_output)
+def test_nmap_xml_parser(nmap_raw_output: str, nmap_raw_output_2: str):
+ n: NmapResult = parse_nmap_xml(nmap_raw_output)
assert n.tcp_open_ports == [61232]
+
+ assert isinstance(n.trace, NmapTrace)
assert len(n.trace.hops) == 18
n = parse_nmap_xml(nmap_raw_output_2)