Skip to content

Commit 7e65e43

Browse files
committed
update unittests
1 parent 99f7e41 commit 7e65e43

File tree

6 files changed

+14
-8
lines changed

6 files changed

+14
-8
lines changed

unittests/tools/test_wazuh_parser.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55

66
class TestWazuhParser(DojoTestCase):
77

8-
def test_parse_no_findings(self):
9-
with (get_unit_tests_scans_path("wazuh") / "no_findings.json").open(encoding="utf-8") as testfile:
8+
def test_parse_v4_7_no_findings(self):
9+
with (get_unit_tests_scans_path("wazuh") / "v4-7_no_findings.json").open(encoding="utf-8") as testfile:
1010
parser = WazuhParser()
1111
findings = parser.get_findings(testfile, Test())
1212
self.assertEqual(0, len(findings))
1313

14-
def test_parse_one_finding(self):
15-
with (get_unit_tests_scans_path("wazuh") / "one_finding.json").open(encoding="utf-8") as testfile:
14+
def test_parse_v4_7_one_finding(self):
15+
with (get_unit_tests_scans_path("wazuh") / "v4-7_one_finding.json").open(encoding="utf-8") as testfile:
1616
parser = WazuhParser()
1717
findings = parser.get_findings(testfile, Test())
1818
for finding in findings:
@@ -25,8 +25,8 @@ def test_parse_one_finding(self):
2525
self.assertEqual("4.3.1", finding.component_version)
2626
self.assertEqual(5.5, finding.cvssv3_score)
2727

28-
def test_parse_many_finding(self):
29-
with (get_unit_tests_scans_path("wazuh") / "many_findings.json").open(encoding="utf-8") as testfile:
28+
def test_parse_v4_7_many_finding(self):
29+
with (get_unit_tests_scans_path("wazuh") / "v4-7_many_findings.json").open(encoding="utf-8") as testfile:
3030
parser = WazuhParser()
3131
findings = parser.get_findings(testfile, Test())
3232
for finding in findings:
@@ -35,8 +35,8 @@ def test_parse_many_finding(self):
3535
self.assertEqual(6, len(findings))
3636
self.assertEqual("2023-02-08", finding.date)
3737

38-
def test_parse_one_finding_with_endpoint(self):
39-
with (get_unit_tests_scans_path("wazuh") / "one_finding_with_endpoint.json").open(encoding="utf-8") as testfile:
38+
def test_parse_v4_7_one_finding_with_endpoint(self):
39+
with (get_unit_tests_scans_path("wazuh") / "v4-7_one_finding_with_endpoint.json").open(encoding="utf-8") as testfile:
4040
parser = WazuhParser()
4141
findings = parser.get_findings(testfile, Test())
4242
for finding in findings:
@@ -51,3 +51,9 @@ def test_parse_one_finding_with_endpoint(self):
5151
self.assertEqual("asdf", finding.component_name)
5252
self.assertEqual("1", finding.component_version)
5353
self.assertEqual("2023-12-13", finding.date)
54+
55+
def test_parse_v4_8_many_findings(self):
56+
with (get_unit_tests_scans_path("wazuh") / "v4-8_many_findings.json").open(encoding="utf-8") as testfile:
57+
parser = WazuhParser()
58+
findings = parser.get_findings(testfile, Test())
59+
self.assertEqual(0, len(findings))

0 commit comments

Comments
 (0)