File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from dojo .models import Test , Test_Type
12from dojo .tools .rusty_hog .parser import RustyhogParser
23from unittests .dojo_test_case import DojoTestCase , get_unit_tests_scans_path
34
@@ -21,6 +22,15 @@ def test_parse_file_with_multiple_vuln_has_multiple_finding_choctawhog(self):
2122 findings = parser .get_findings (testfile , "Choctaw Hog" )
2223 self .assertEqual (13 , len (findings ))
2324
25+ def test_parse_file_with_multiple_vuln_test_type (self ):
26+ with (get_unit_tests_scans_path ("rusty_hog" ) / "choctawhog_many_vulns.json" ).open (encoding = "utf-8" ) as testfile :
27+ test_type = Test_Type (name = "Rusty Hog" )
28+ test = Test (test_type = test_type )
29+ self .assertEqual ("Rusty Hog" , test .test_type .name )
30+ parser = RustyhogParser ()
31+ tests = parser .get_tests ("Rusty Hog" , testfile )
32+ self .assertEqual ("Rusty Hog" , tests [0 ].name )
33+
2434 def test_parse_file_with_multiple_vuln_has_multiple_finding_choctawhog_content (self ):
2535 with (get_unit_tests_scans_path ("rusty_hog" ) / "choctawhog_many_vulns.json" ).open (encoding = "utf-8" ) as testfile :
2636 parser = RustyhogParser ()
You can’t perform that action at this time.
0 commit comments