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 pathlib import Path
21
3- from django .test import TestCase
42
53from dojo .models import Test
64from dojo .tools .snyk_issue_api .parser import SnykIssueApiParser
75from unittests .dojo_test_case import DojoTestCase , get_unit_tests_scans_path
86
7+
98class TestSnykIssueApiParserWithJson (DojoTestCase ):
109 def parse_json (self , filename ):
1110 testfile = (get_unit_tests_scans_path ("snyk_issue_api" ) / filename ).open (encoding = "utf-8" )
1211 parser = SnykIssueApiParser ()
1312 return parser .get_findings (testfile , Test ())
1413
15-
1614 def test_parse_sca_single_finding (self ):
1715 findings = self .parse_json ("snyk_sca_scan_api_single_vuln.json" )
1816 self .assertEqual (1 , len (findings ))
@@ -496,4 +494,4 @@ def test_deduplication_fields_match_other_snyk_scans_for_code(self):
496494 # currently deduplication is only done via 2 fields 'vuln_id_from_tool' and 'file_path'
497495 # !!! sarif value is something like 'python/CodeInjection', cannot be matched
498496 self .assertEqual ("9a29d87f-aa94-47eb-b46f-375b293a8631" , finding .vuln_id_from_tool )
499- self .assertEqual ("path/path/file.abc" , finding .file_path )
497+ self .assertEqual ("path/path/file.abc" , finding .file_path )
You can’t perform that action at this time.
0 commit comments