Skip to content

Commit

Permalink
fix(filters): mimic hit on /finding/open (test)
Browse files Browse the repository at this point in the history
  • Loading branch information
p-l- committed May 21, 2024
1 parent 18bc04b commit f3f4a31
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions unittests/tools/test_generic_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,3 +650,11 @@ def test_parse_json_invalid_finding(self):
with self.assertRaisesMessage(ValueError,
"Not allowed fields are present: ['invalid_field', 'last_status_update']"):
parser.get_findings(file, Test())

def test_parse_json_bad_date(self):
with open("unittests/scans/generic/generic_bad_date.json") as fdesc:

Check failure on line 655 in unittests/tools/test_generic_parser.py

View workflow job for this annotation

GitHub Actions / ruff-linting

Ruff (F841)

unittests/tools/test_generic_parser.py:655:71: F841 Local variable `fdesc` is assigned to but never used

Check notice on line 655 in unittests/tools/test_generic_parser.py

View workflow job for this annotation

GitHub Actions / flake8-your-pr

unittests/tools/test_generic_parser.py#L655

local variable 'fdesc' is assigned to but never used (F841)
parser = GenericParser()
findings = parser.get_findings(file, Test())
self.assertEqual(1, len(findings))
# test the filters
self.assertEqual(1, len(Finding.objects.filter(active=True)))

0 comments on commit f3f4a31

Please sign in to comment.