-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update risk scores in create_vulnerabilities #102
Signed-off-by: tdruez <[email protected]>
- Loading branch information
Showing
3 changed files
with
11 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,13 +82,17 @@ def test_vulnerability_mixin_create_vulnerabilities(self): | |
vulnerabilities_data = response_json["results"][0]["affected_by_vulnerabilities"] | ||
|
||
package1 = make_package(self.dataspace, package_url="pkg:pypi/[email protected]") | ||
product1 = make_product(self.dataspace, inventory=[package1]) | ||
package1.create_vulnerabilities(vulnerabilities_data) | ||
|
||
self.assertEqual(1, Vulnerability.objects.scope(self.dataspace).count()) | ||
self.assertEqual(1, package1.affected_by_vulnerabilities.count()) | ||
vulnerability = package1.affected_by_vulnerabilities.get() | ||
self.assertEqual("VCID-j3au-usaz-aaag", vulnerability.vulnerability_id) | ||
|
||
self.assertEqual(8.4, package1.risk_score) | ||
self.assertEqual("8.4", str(product1.productpackages.get().weighted_risk_score)) | ||
|
||
def test_vulnerability_model_affected_packages_m2m(self): | ||
package1 = make_package(self.dataspace) | ||
vulnerability1 = make_vulnerability(dataspace=self.dataspace, affecting=package1) | ||
|