Skip to content

Commit c333882

Browse files
committed
rename class
Signed-off-by: tdruez <tdruez@aboutcode.org>
1 parent 95fb3dc commit c333882

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

policy/rules.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ def count_violations(self, product, threshold, parameters):
140140
return count if count > threshold else 0
141141

142142

143-
class UnresolvedVulnerabilityCountRule(BaseRule):
144-
rule_type = "unresolved_vulnerability_count"
145-
label = "Unresolved Vulnerability Count"
143+
class UnresolvedVulnerabilityRule(BaseRule):
144+
rule_type = "unresolved_vulnerability"
145+
label = "Unresolved Vulnerability"
146146
severity = "warning"
147147
description = (
148148
"Detects packages with known vulnerabilities that have not been triaged or addressed."
@@ -232,6 +232,6 @@ def count_violations(self, product, threshold, parameters):
232232
LicensePolicyWarningRule.rule_type: LicensePolicyWarningRule(),
233233
LicenseCoverageGapRule.rule_type: LicenseCoverageGapRule(),
234234
VulnerabilityDetectedRule.rule_type: VulnerabilityDetectedRule(),
235-
UnresolvedVulnerabilityCountRule.rule_type: UnresolvedVulnerabilityCountRule(),
235+
UnresolvedVulnerabilityRule.rule_type: UnresolvedVulnerabilityRule(),
236236
StaleVulnerabilityRule.rule_type: StaleVulnerabilityRule(),
237237
}

policy/tests/test_rules.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from policy.rules import LicensePolicyErrorRule
2424
from policy.rules import LicensePolicyWarningRule
2525
from policy.rules import StaleVulnerabilityRule
26-
from policy.rules import UnresolvedVulnerabilityCountRule
26+
from policy.rules import UnresolvedVulnerabilityRule
2727
from policy.rules import UsagePolicyErrorRule
2828
from policy.rules import UsagePolicyWarningRule
2929
from policy.rules import VulnerabilityDetectedRule
@@ -182,7 +182,7 @@ def test_min_risk_score_includes_packages_at_or_above_threshold(self):
182182
self.assertEqual(1, count)
183183

184184

185-
class UnresolvedVulnerabilityCountRuleTestCase(TestCase):
185+
class UnresolvedVulnerabilityRuleTestCase(TestCase):
186186
def setUp(self):
187187
self.dataspace = Dataspace.objects.create(name="nexB")
188188
self.product = make_product(self.dataspace)
@@ -191,15 +191,15 @@ def test_counts_unanalyzed_package_vulnerability_links(self):
191191
package = make_package(self.dataspace)
192192
make_vulnerability(self.dataspace, affecting=package)
193193
make_product_package(self.product, package=package)
194-
count = UnresolvedVulnerabilityCountRule().count_violations(self.product, 0, {})
194+
count = UnresolvedVulnerabilityRule().count_violations(self.product, 0, {})
195195
self.assertEqual(1, count)
196196

197197
def test_does_not_count_links_with_terminal_analysis(self):
198198
package = make_package(self.dataspace)
199199
vulnerability = make_vulnerability(self.dataspace, affecting=package)
200200
product_package = make_product_package(self.product, package=package)
201201
make_vulnerability_analysis(product_package, vulnerability, state="resolved")
202-
count = UnresolvedVulnerabilityCountRule().count_violations(self.product, 0, {})
202+
count = UnresolvedVulnerabilityRule().count_violations(self.product, 0, {})
203203
self.assertEqual(0, count)
204204

205205

0 commit comments

Comments
 (0)