-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Tushar Goel <[email protected]>
- Loading branch information
Showing
1 changed file
with
13 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,8 +124,8 @@ def test_filter_vulnerabilities_multiple_ids(self): | |
url = reverse("vulnerability-v2-list") | ||
with self.assertNumQueries(5): | ||
response = self.client.get( | ||
url, {"vulnerability_id": ["VCID-1234", "VCID-5678"]}, format="json" | ||
) | ||
url, {"vulnerability_id": ["VCID-1234", "VCID-5678"]}, format="json" | ||
) | ||
self.assertEqual(response.status_code, status.HTTP_200_OK) | ||
self.assertEqual(len(response.data["results"]["vulnerabilities"]), 2) | ||
|
||
|
@@ -136,8 +136,8 @@ def test_filter_vulnerabilities_multiple_aliases(self): | |
url = reverse("vulnerability-v2-list") | ||
with self.assertNumQueries(5): | ||
response = self.client.get( | ||
url, {"alias": ["CVE-2021-1234", "CVE-2021-5678"]}, format="json" | ||
) | ||
url, {"alias": ["CVE-2021-1234", "CVE-2021-5678"]}, format="json" | ||
) | ||
self.assertEqual(response.status_code, status.HTTP_200_OK) | ||
self.assertEqual(len(response.data["results"]["vulnerabilities"]), 2) | ||
|
||
|
@@ -250,7 +250,9 @@ def test_filter_packages_by_affected_vulnerability(self): | |
""" | ||
url = reverse("package-v2-list") | ||
with self.assertNumQueries(19): | ||
response = self.client.get(url, {"affected_by_vulnerability": "VCID-1234"}, format="json") | ||
response = self.client.get( | ||
url, {"affected_by_vulnerability": "VCID-1234"}, format="json" | ||
) | ||
self.assertEqual(response.status_code, status.HTTP_200_OK) | ||
self.assertEqual(len(response.data["results"]["packages"]), 1) | ||
self.assertEqual(response.data["results"]["packages"][0]["purl"], "pkg:pypi/[email protected]") | ||
|
@@ -346,7 +348,9 @@ def test_invalid_vulnerability_filter(self): | |
""" | ||
url = reverse("package-v2-list") | ||
with self.assertNumQueries(4): | ||
response = self.client.get(url, {"affected_by_vulnerability": "VCID-9999"}, format="json") | ||
response = self.client.get( | ||
url, {"affected_by_vulnerability": "VCID-9999"}, format="json" | ||
) | ||
self.assertEqual(response.status_code, status.HTTP_200_OK) | ||
self.assertEqual(len(response.data["results"]["packages"]), 0) | ||
|
||
|
@@ -357,7 +361,9 @@ def test_invalid_purl_filter(self): | |
""" | ||
url = reverse("package-v2-list") | ||
with self.assertNumQueries(4): | ||
response = self.client.get(url, {"purl": "pkg:nonexistent/[email protected]"}, format="json") | ||
response = self.client.get( | ||
url, {"purl": "pkg:nonexistent/[email protected]"}, format="json" | ||
) | ||
self.assertEqual(response.status_code, status.HTTP_200_OK) | ||
self.assertEqual(len(response.data["results"]["packages"]), 0) | ||
|
||
|