File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99class TestZoraParser (DojoTestCase ):
1010
1111 def test_parse_file_with_no_vuln_has_no_finding (self ):
12- with (get_unit_tests_scans_path ("zora" ) / "zora_no_vuln .csv" ).open (encoding = "utf-8" ) as testfile :
12+ with (get_unit_tests_scans_path ("zora" ) / "scan_empty .csv" ).open (encoding = "utf-8" ) as testfile :
1313 reader = csv .DictReader (testfile )
1414 parser = ZoraParser ()
1515 findings = parser .get_findings (Test (), reader )
1616 self .assertEqual (0 , len (findings ))
1717
1818 def test_parse_file_with_many_vuln_has_many_findings (self ):
19- with (get_unit_tests_scans_path ("zora" ) / "zora_many_vuln .csv" ).open (encoding = "utf-8" ) as testfile :
19+ with (get_unit_tests_scans_path ("zora" ) / "scan_many .csv" ).open (encoding = "utf-8" ) as testfile :
2020 reader = csv .DictReader (testfile )
2121 parser = ZoraParser ()
2222 findings = parser .get_findings (Test (), reader )
23- self .assertEqual (50 , len (findings )) # Adjust based on your test file
23+ self .assertEqual (198 , len (findings )) # Adjust based on your test file
2424 # Check a specific finding for correctness
2525 finding = findings [10 ]
26+ self .assertEqual ("net/url: Insufficient validation of bracketed IPv6 hostnames in net/url" , finding .title )
2627 self .assertEqual ("Medium" , finding .severity )
2728 self .assertTrue (finding .unique_id_from_tool .startswith (f"{ finding .description .splitlines ()[0 ].split (': ' )[1 ]} " ))
2829 self .assertIn ("Fix Version" , finding .description )
You can’t perform that action at this time.
0 commit comments