Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jjeff07 committed Mar 3, 2022
1 parent 2626811 commit 4e57786
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/unittests/tools/test_nist.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,15 @@ def test_check_other(self, get):
@patch("httpx.Client.get")
def test_check_timeout(self, get):
get().raise_for_status.side_effect = ReadTimeout("Timeout")
res = self.vuln.check_cve("riverbed", "steelhead", "6.5.2a")
res = self.vuln.check_cve("cisco", "steelhead", "6.5.2a")
self.assertEqual(res.error, "Timeout")

@patch("httpx.Client.get")
def test_check_error(self, get):
get().raise_for_status.side_effect = HTTPStatusError("Timeout", request=MagicMock(), response=MagicMock())
res = self.vuln.check_cve("riverbed", "steelhead", "6.5.2a")
res = self.vuln.check_cve("cisco", "steelhead", "6.5.2a")
self.assertEqual(res.error, "HTTP Error")

def test_check_unsupported(self):
res = self.vuln.check_cve("riverbed", "steelhead", "6.5.2a")
self.assertEqual(res.error, "Unsupported")

0 comments on commit 4e57786

Please sign in to comment.