4949from scanpipe .pipes import flag
5050from scanpipe .pipes import purldb
5151from scanpipe .tests import filter_warnings
52+ from scanpipe .tests import make_dependency
5253from scanpipe .tests import make_mock_response
5354from scanpipe .tests import make_package
5455from scanpipe .tests import make_project
@@ -1224,8 +1225,12 @@ def test_scanpipe_management_command_check_compliance_vulnerabilities(self):
12241225 out_value = out .getvalue ().strip ()
12251226 self .assertEqual ("No vulnerabilities found" , out_value )
12261227
1227- package1 .update (
1228- affected_by_vulnerabilities = [{"vulnerability_id" : "VCID-cah8-awtr-aaad" }]
1228+ vulnerability_data = [{"vulnerability_id" : "VCID-cah8-awtr-aaad" }]
1229+ package1 .update (affected_by_vulnerabilities = vulnerability_data )
1230+ make_dependency (
1231+ project ,
1232+ dependency_uid = "dependency1" ,
1233+ affected_by_vulnerabilities = vulnerability_data ,
12291234 )
12301235 out = StringIO ()
12311236 options = ["--project" , project .name , "--fail-on-vulnerabilities" ]
@@ -1234,7 +1239,11 @@ def test_scanpipe_management_command_check_compliance_vulnerabilities(self):
12341239 self .assertEqual (cm .exception .code , 1 )
12351240 out_value = out .getvalue ().strip ()
12361241 expected = (
1237- "1 vulnerable records found:\n pkg:generic/name@1.0\n > VCID-cah8-awtr-aaad"
1242+ "2 vulnerable records found:\n "
1243+ "pkg:generic/name@1.0\n "
1244+ " > VCID-cah8-awtr-aaad\n "
1245+ "dependency1\n "
1246+ " > VCID-cah8-awtr-aaad"
12381247 )
12391248 self .assertEqual (expected , out_value )
12401249
0 commit comments