3232from requests .models import Response
3333from packageurl import PackageURL
3434
35+ from vulnerabilities .data_source import Advisory
36+ from vulnerabilities .data_source import VulnerabilityReferenceUnit
3537from vulnerabilities .importers .github import GitHubAPIDataSource
3638from vulnerabilities .importers .github import MavenVersionAPI
3739from vulnerabilities .importers .github import ComposerVersionAPI
3840from vulnerabilities .importers .github import NugetVersionAPI
3941from vulnerabilities .importers .github import GitHubTokenError
4042from vulnerabilities .importers .github import query
41- from vulnerabilities .data_source import Advisory
4243
4344BASE_DIR = os .path .dirname (os .path .abspath (__file__ ))
4445TEST_DATA = os .path .join (BASE_DIR , 'test_data' )
@@ -186,8 +187,9 @@ def test_process_response(self):
186187 subpath = None ,
187188 ),
188189 },
189- reference_urls = [],
190- reference_ids = {'GHSA-qcxh-w3j9-58qr' },
190+ vuln_references = [VulnerabilityReferenceUnit (
191+ url = 'https://github.com/advisories/GHSA-qcxh-w3j9-58qr' ,
192+ reference_id = 'GHSA-qcxh-w3j9-58qr' )],
191193 cve_id = 'CVE-2019-0199' ,
192194 ),
193195 Advisory (
@@ -212,8 +214,9 @@ def test_process_response(self):
212214 subpath = None ,
213215 )
214216 },
215- reference_urls = [],
216- reference_ids = {'GHSA-qcxh-w3j9-58qr' },
217+ vuln_references = [VulnerabilityReferenceUnit (
218+ url = 'https://github.com/advisories/GHSA-qcxh-w3j9-58qr' ,
219+ reference_id = 'GHSA-qcxh-w3j9-58qr' )],
217220 cve_id = 'CVE-2019-0199' ,
218221 ),
219222 Advisory (
@@ -237,8 +240,9 @@ def test_process_response(self):
237240 subpath = None ,
238241 ),
239242 },
240- reference_urls = [],
241- reference_ids = {'GHSA-c9hw-wf7x-jp9j' },
243+ vuln_references = [VulnerabilityReferenceUnit (
244+ url = 'https://github.com/advisories/GHSA-c9hw-wf7x-jp9j' ,
245+ reference_id = 'GHSA-c9hw-wf7x-jp9j' )],
242246 cve_id = 'CVE-2020-1938' ,
243247 ),
244248 Advisory (
@@ -262,8 +266,9 @@ def test_process_response(self):
262266 subpath = None ,
263267 ),
264268 },
265- reference_urls = [],
266- reference_ids = {'GHSA-c9hw-wf7x-jp9j' },
269+ vuln_references = [VulnerabilityReferenceUnit (
270+ url = 'https://github.com/advisories/GHSA-c9hw-wf7x-jp9j' ,
271+ reference_id = 'GHSA-c9hw-wf7x-jp9j' )],
267272 cve_id = 'CVE-2020-1938' ,
268273 ),
269274 Advisory (
@@ -288,8 +293,9 @@ def test_process_response(self):
288293 subpath = None ,
289294 )
290295 },
291- reference_urls = [],
292- reference_ids = {'GHSA-c9hw-wf7x-jp9j' },
296+ vuln_references = [VulnerabilityReferenceUnit (
297+ url = 'https://github.com/advisories/GHSA-c9hw-wf7x-jp9j' ,
298+ reference_id = 'GHSA-c9hw-wf7x-jp9j' )],
293299 cve_id = 'CVE-2020-1938' ,
294300 ),
295301 ]
@@ -433,7 +439,8 @@ def test_artifact_url(self):
433439
434440 def test_extract_versions (self ):
435441 expected_versions = {'1.2.2' , '1.2.3' , '1.3.0' }
436- assert expected_versions == self .version_api .extract_versions (self .response )
442+ assert expected_versions == self .version_api .extract_versions (
443+ self .response )
437444
438445 def test_load_to_api (self ):
439446
0 commit comments