5
5
6
6
class TestWazuhParser (DojoTestCase ):
7
7
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 :
10
10
parser = WazuhParser ()
11
11
findings = parser .get_findings (testfile , Test ())
12
12
self .assertEqual (0 , len (findings ))
13
13
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 :
16
16
parser = WazuhParser ()
17
17
findings = parser .get_findings (testfile , Test ())
18
18
for finding in findings :
@@ -25,8 +25,8 @@ def test_parse_one_finding(self):
25
25
self .assertEqual ("4.3.1" , finding .component_version )
26
26
self .assertEqual (5.5 , finding .cvssv3_score )
27
27
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 :
30
30
parser = WazuhParser ()
31
31
findings = parser .get_findings (testfile , Test ())
32
32
for finding in findings :
@@ -35,8 +35,8 @@ def test_parse_many_finding(self):
35
35
self .assertEqual (6 , len (findings ))
36
36
self .assertEqual ("2023-02-08" , finding .date )
37
37
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 :
40
40
parser = WazuhParser ()
41
41
findings = parser .get_findings (testfile , Test ())
42
42
for finding in findings :
@@ -51,3 +51,9 @@ def test_parse_one_finding_with_endpoint(self):
51
51
self .assertEqual ("asdf" , finding .component_name )
52
52
self .assertEqual ("1" , finding .component_version )
53
53
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