File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
vulnerabilities/tests/pipes Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -269,6 +269,7 @@ def test_patch_advisory(dumpy_patch_advisory):
269269 adv = AdvisoryV2 .objects .get (advisory_id = "ADV-1234" )
270270
271271 assert ImpactedPackage .objects .count () == 6
272+
272273 assert [
273274 (
274275 package_commit_patch .commit_hash ,
@@ -291,6 +292,17 @@ def test_patch_advisory(dumpy_patch_advisory):
291292 "a5d6b89c35224d4ed69910a18fb544ca3fb26f62db53bc2769ce8a8d5cf8874c191186d170cb6e8896b0aaa8eaed891e7e819c4c0c7af499397c84761d6fb22d" ,
292293 ),
293294 ]
295+
296+ pkg_patches_that_fix = (
297+ PackageCommitPatch .objects .filter (fixed_in_impacts__isnull = False ).distinct ().count ()
298+ )
299+ assert pkg_patches_that_fix == 1
300+
301+ pkg_patches_that_introduce = (
302+ PackageCommitPatch .objects .filter (introduced_in_impacts__isnull = False ).distinct ().count ()
303+ )
304+ assert pkg_patches_that_introduce == 1
305+
294306 assert (
295307 PackageCommitPatch .objects .count () == 2
296308 ) # Only 2 are created because the 6 inputs include duplicates with the VCS URL and commit_hash
You can’t perform that action at this time.
0 commit comments