Skip to content

Commit 107cdaf

Browse files
committed
Use supported_ecosystem to skip unsupported PURLs
Signed-off-by: Omkar Phansopkar <omkarphansopkar@gmail.com>
1 parent 23fb8f5 commit 107cdaf

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

vulntotal/datasources/safetydb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def fetch_advisory(self):
4646
return response.json()
4747

4848
def datasource_advisory(self, purl) -> Iterable[VendorData]:
49-
if purl.type != "pypi":
49+
if purl.type not in self.supported_ecosystem():
5050
return []
5151
advisory = self.fetch_advisory()
5252
self._raw_dump.append(advisory)

vulntotal/tests/test_safetydb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from vulntotal.datasources import safetydb
1818

1919

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

2323
def test_parse_advisory(self):

0 commit comments

Comments
 (0)