Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,20 @@ aboutcode-toolkit==11.1.1
alabaster==1.0.0
anyio==4.11.0
babel==2.17.0
backports.tarfile==1.2.0
boolean.py==5.0
cffi==2.0.0
colorama==0.4.6
cryptography==46.0.3
doc8==2.0.0
docutils==0.21.2
et_xmlfile==2.0.0
exceptiongroup==1.3.0
execnet==2.1.1
h11==0.16.0
id==1.5.0
imagesize==1.4.1
importlib_metadata==8.7.0
iniconfig==2.3.0
jaraco.classes==3.4.0
jaraco.context==6.0.1
Expand All @@ -39,17 +42,16 @@ requests-toolbelt==1.0.0
restructuredtext_lint==1.4.0
rfc3986==2.0.0
rich==14.2.0
roman-numerals-py==3.1.0
ruff==0.14.2
secretstorage==3.4.0
sniffio==1.3.1
snowballstemmer==3.0.1
sphinx==8.2.3
sphinx-autobuild==2025.8.25
sphinx==8.1.3
sphinx-autobuild==2024.10.3
sphinx-copybutton==0.5.2
sphinx-reredirects==1.0.0
sphinx-rtd-dark-mode==1.3.0
sphinx-rtd-theme==3.0.2
sphinx_reredirects==0.1.6
sphinxcontrib-applehelp==2.0.0
sphinxcontrib-devhelp==2.0.0
sphinxcontrib-htmlhelp==2.1.0
Expand All @@ -59,7 +61,9 @@ sphinxcontrib-qthelp==2.0.0
sphinxcontrib-serializinghtml==2.0.0
starlette==0.48.0
stevedore==5.5.0
tomli==2.3.0
twine==6.2.0
uvicorn==0.38.0
watchfiles==1.1.1
websockets==15.0.1
websockets==15.0.1
zipp==3.23.0
13 changes: 8 additions & 5 deletions tests/test_purl_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ def tearDown(self):
fileutils.delete(purl_map.parent)
return super().tearDown()

def create_purl_map(self, purls):
purl_map_loc = purl_validator.create_purl_map(purls)
self.created_purl_maps.append(purl_map_loc)
return purl_map_loc

def test_purl_validator_create_purl_map_entry(self):
test_purl1 = PackageURL(type="npm", namespace="@test", name="test", version="1.0")
test_purl2 = "pkg:npm/test2@2.0"
Expand All @@ -56,16 +61,14 @@ def test_purl_validator_create_purl_map_entry(self):
test_purl4 = []
purls = [test_purl1, test_purl2]

purl_map_loc = purl_validator.create_purl_map(purls)
self.created_purl_maps.append(purl_map_loc)

purl_map_loc = self.create_purl_map(purls)
purl_map = purl_validator.PurlValidator.load_map(purl_map_loc)
expected_results = [(b"npm/@test/test", 1), (b"npm/test2", 1)]
results = [(k, v) for k, v in purl_map.items()]
self.assertEqual(expected_results, results)

with self.assertRaises(ValueError):
purl_validator.create_purl_map([test_purl3])
self.create_purl_map([test_purl3])

with self.assertRaises(ValueError):
purl_validator.create_purl_map([test_purl4])
self.create_purl_map([test_purl4])