Skip to content

Commit

Permalink
Fingerprint Unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
farsheedify authored and root committed Jan 3, 2025
1 parent 0b21cc1 commit fe49ea4
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions unittests/tools/test_semgrep_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,10 @@ def test_fingerprint_requires_login_and_null(self):
with open("unittests/scans/semgrep/fingerprint_test.json", encoding="utf-8") as testfile:
parser = SemgrepParser()
findings = parser.get_findings(testfile, Test())
self.assertEqual(2, len(findings)) # Ensure two findings are parsed
# First finding has fingerprint "requires login"
self.assertEqual(2, len(findings))
self.assertEqual("", findings[0].unique_id_from_tool)
self.assertEqual("src/test1.java", findings[0].file_path)
self.assertEqual(10, findings[0].line)
# Second finding has fingerprint "null"
self.assertEqual("sample/brute.py", findings[0].file_path)
self.assertEqual(31, findings[0].line)
self.assertEqual("", findings[1].unique_id_from_tool)
self.assertEqual("src/test2.java", findings[1].file_path)
self.assertEqual(20, findings[1].line)
self.assertEqual("sample/function.go", findings[1].file_path)
self.assertEqual(37, findings[1].line)

0 comments on commit fe49ea4

Please sign in to comment.