99
1010import json
1111import os
12+ import pytest
1213from pathlib import Path
1314from types import SimpleNamespace
1415
@@ -39,6 +40,7 @@ def test_package_first_mode_valid_npm_package(tmp_path):
3940 pipeline = NpmLiveImporterPipeline (purl = purl )
4041 pipeline .vcs_response = mock_vcs_response
4142
43+ pipeline .get_purl_inputs ()
4244 advisories = list (pipeline .collect_advisories ())
4345
4446 assert len (advisories ) == 1
@@ -64,6 +66,7 @@ def test_package_first_mode_unaffected_version(tmp_path):
6466 pipeline = NpmLiveImporterPipeline (purl = purl )
6567 pipeline .vcs_response = mock_vcs_response
6668
69+ pipeline .get_purl_inputs ()
6770 advisories = list (pipeline .collect_advisories ())
6871
6972 assert len (advisories ) == 0
@@ -79,9 +82,8 @@ def test_package_first_mode_invalid_package_type(tmp_path):
7982 pipeline = NpmLiveImporterPipeline (purl = purl )
8083 pipeline .vcs_response = mock_vcs_response
8184
82- advisories = list (pipeline .collect_advisories ())
83-
84- assert len (advisories ) == 0
85+ with pytest .raises (ValueError ):
86+ pipeline .get_purl_inputs ()
8587
8688
8789def test_package_first_mode_package_not_found (tmp_path ):
@@ -103,6 +105,7 @@ def test_package_first_mode_package_not_found(tmp_path):
103105 pipeline = NpmLiveImporterPipeline (purl = purl )
104106 pipeline .vcs_response = mock_vcs_response
105107
108+ pipeline .get_purl_inputs ()
106109 advisories = list (pipeline .collect_advisories ())
107110
108111 assert len (advisories ) == 0
@@ -111,6 +114,7 @@ def test_package_first_mode_package_not_found(tmp_path):
111114def test_version_is_affected ():
112115 purl = PackageURL (type = "npm" , name = "npm" , version = "1.2.0" )
113116 pipeline = NpmLiveImporterPipeline (purl = purl )
117+ pipeline .get_purl_inputs ()
114118
115119 affected_package = AffectedPackage (
116120 package = PackageURL (type = "npm" , name = "npm" ),
0 commit comments