Skip to content

Commit 3d72540

Browse files
committed
underline the correctness through comparison with rustyhog
1 parent f1f246e commit 3d72540

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

unittests/tools/test_rusty_hog_parser.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from dojo.models import Test, Test_Type
12
from dojo.tools.rusty_hog.parser import RustyhogParser
23
from 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()

0 commit comments

Comments
 (0)