aboutsummaryrefslogtreecommitdiff
path: root/tests/models/network/test_nmap_parser.py
diff options
context:
space:
mode:
authorstuppie2026-09-04 12:52:46 -0600
committerstuppie2026-09-04 12:52:46 -0600
commit4b705346968e38671ac9601cfa8444c944ecc8bd (patch)
tree8aa812e35846a72b3965d136642ea84c689ec22a /tests/models/network/test_nmap_parser.py
parent493f131d6ffe1629ffb3610165271c3c87b32d3b (diff)
downloadgeneralresearch-4b705346968e38671ac9601cfa8444c944ecc8bd.tar.gz
generalresearch-4b705346968e38671ac9601cfa8444c944ecc8bd.zip
remove a lot of if type_checking; fix model_rebuild errors. Remove all network models/managers/test/fixtures
Diffstat (limited to 'tests/models/network/test_nmap_parser.py')
-rw-r--r--tests/models/network/test_nmap_parser.py32
1 files changed, 0 insertions, 32 deletions
diff --git a/tests/models/network/test_nmap_parser.py b/tests/models/network/test_nmap_parser.py
deleted file mode 100644
index fc9884b..0000000
--- a/tests/models/network/test_nmap_parser.py
+++ /dev/null
@@ -1,32 +0,0 @@
-from __future__ import annotations
-
-import os
-from typing import TYPE_CHECKING
-
-import pytest
-
-from generalresearch.models.network.nmap.parser import parse_nmap_xml
-from generalresearch.models.network.nmap.result import NmapTrace
-
-if TYPE_CHECKING:
- from generalresearch.models.network.nmap.result import NmapResult
-
-
-@pytest.fixture
-def nmap_raw_output_2(request) -> str:
- fp = os.path.join(request.config.rootpath, "data/nmaprun2.xml")
- with open(fp) as f:
- data = f.read()
- return data
-
-
-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)
- assert n.tcp_open_ports == [22, 80, 9929, 31337]
- assert n.trace is None