-
Notifications
You must be signed in to change notification settings - Fork 88
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: Ayan Sinha Mahapatra <[email protected]>
- Loading branch information
1 parent
fae73bf
commit 44711ea
Showing
6 changed files
with
137 additions
and
43 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
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
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
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
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 |
---|---|---|
|
@@ -49,6 +49,7 @@ | |
from django.utils import timezone | ||
|
||
from packagedcode.models import PackageData | ||
from packageurl import PackageURL | ||
from requests.exceptions import RequestException | ||
from rq.job import JobStatus | ||
|
||
|
@@ -65,6 +66,7 @@ | |
from scanpipe.models import UUIDTaggedItem | ||
from scanpipe.models import convert_glob_to_django_regex | ||
from scanpipe.models import get_project_work_directory | ||
from scanpipe.models import normalize_package_url_data | ||
from scanpipe.pipes.fetch import Download | ||
from scanpipe.pipes.input import copy_input | ||
from scanpipe.tests import dependency_data1 | ||
|
@@ -730,6 +732,17 @@ def test_scanpipe_project_get_ignored_dependency_scopes_index(self): | |
expected = {"npm": ["devDependencies"], "pypi": ["tests", "build"]} | ||
self.assertEqual(expected, self.project1.get_ignored_dependency_scopes_index()) | ||
|
||
def test_scanpipe_normalize_package_url_data(self): | ||
purl = PackageURL.from_string("pkg:npm/[email protected]") | ||
purl_data = normalize_package_url_data(purl_mapping=purl.to_dict()) | ||
self.assertEqual(purl_data.get("namespace"), "") | ||
|
||
purl_data = normalize_package_url_data( | ||
purl_mapping=purl.to_dict(), | ||
ignore_nulls=True, | ||
) | ||
self.assertEqual(purl_data.get("namespace"), None) | ||
|
||
def test_scanpipe_project_get_ignored_vulnerabilities_set(self): | ||
self.project1.settings = { | ||
"ignored_vulnerabilities": [ | ||
|
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