Skip to content

Commit

Permalink
Use supported_ecosystem to skip unsupported PURLs
Browse files Browse the repository at this point in the history
Signed-off-by: Omkar Phansopkar <omkarphansopkar@gmail.com>
  • Loading branch information
OmkarPh committed May 13, 2024
1 parent 23fb8f5 commit 107cdaf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion vulntotal/datasources/safetydb.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def fetch_advisory(self):
return response.json()

def datasource_advisory(self, purl) -> Iterable[VendorData]:
if purl.type != "pypi":
if purl.type not in self.supported_ecosystem():
return []
advisory = self.fetch_advisory()
self._raw_dump.append(advisory)
Expand Down
2 changes: 1 addition & 1 deletion vulntotal/tests/test_safetydb.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from vulntotal.datasources import safetydb


class TestGithub(testcase.FileBasedTesting):
class TestSafetydb(testcase.FileBasedTesting):
test_data_dir = str(Path(__file__).resolve().parent / "test_data" / "safetydb")

def test_parse_advisory(self):
Expand Down

0 comments on commit 107cdaf

Please sign in to comment.