Skip to content

Commit f1e92e3

Browse files
Fix sonatype-lift warnings
Signed-off-by: Rodney Richardson <[email protected]>
1 parent 2b47ff6 commit f1e92e3

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

tests/test_model.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ def test_sort(self) -> None:
170170
class TestModelLicenseChoice(TestCase):
171171

172172
def test_sort(self) -> None:
173-
license_a = License(spdx_license_id='Apache-2.0'),
174-
license_b = License(spdx_license_id='MIT'),
173+
license_a = License(spdx_license_id='Apache-2.0')
174+
license_b = License(spdx_license_id='MIT')
175175

176176
# expected sort order: ([license], [expression])
177177
expected_order = [1, 0, 3, 2]
@@ -553,7 +553,7 @@ def test_sort(self) -> None:
553553
Property(name='a', value='a'),
554554
Property(name='b', value='b'),
555555
Property(name='a', value='c'),
556-
Property(name='a', value=None),
556+
Property(name='a', value='d'),
557557
Property(name='b', value='a'),
558558
Property(name='a', value='b'),
559559
]

tests/test_model_vulnerability.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
# SPDX-License-Identifier: Apache-2.0
1818
# Copyright (c) OWASP Foundation. All Rights Reserved.
1919

20+
from decimal import Decimal
2021
import unittest
2122
from unittest import TestCase
2223
from unittest.mock import Mock, patch
@@ -272,17 +273,18 @@ def test_sort(self) -> None:
272273
# expected sort order: ([severity], [score], [source], [method], [vector], [justification])
273274
expected_order = [0, 1, 2, 3, 4, 5, 6, 7]
274275
refs = [
275-
VulnerabilityRating(severity=VulnerabilitySeverity.HIGH, score=10, source=source_a,
276-
method=method_a, vector='a', justification='a'),
277-
VulnerabilityRating(severity=VulnerabilitySeverity.HIGH, score=10,
276+
VulnerabilityRating(severity=VulnerabilitySeverity.HIGH, score=Decimal(10),
277+
source=source_a, method=method_a, vector='a', justification='a'),
278+
VulnerabilityRating(severity=VulnerabilitySeverity.HIGH, score=Decimal(10),
278279
source=source_a, method=method_a, vector='a'),
279-
VulnerabilityRating(severity=VulnerabilitySeverity.HIGH, score=10, source=source_a, method=method_a),
280-
VulnerabilityRating(severity=VulnerabilitySeverity.HIGH, score=10, source=source_a),
281-
VulnerabilityRating(severity=VulnerabilitySeverity.HIGH, score=10),
280+
VulnerabilityRating(severity=VulnerabilitySeverity.HIGH, score=Decimal(10),
281+
source=source_a, method=method_a),
282+
VulnerabilityRating(severity=VulnerabilitySeverity.HIGH, score=Decimal(10), source=source_a),
283+
VulnerabilityRating(severity=VulnerabilitySeverity.HIGH, score=Decimal(10)),
282284
VulnerabilityRating(severity=VulnerabilitySeverity.HIGH),
283-
VulnerabilityRating(severity=VulnerabilitySeverity.LOW, score=10, source=source_a,
284-
method=method_a, vector='a', justification='a'),
285-
VulnerabilityRating(score=10, source=source_a, method=method_a, vector='a', justification='a'),
285+
VulnerabilityRating(severity=VulnerabilitySeverity.LOW, score=Decimal(10),
286+
source=source_a, method=method_a, vector='a', justification='a'),
287+
VulnerabilityRating(score=Decimal(10), source=source_a, method=method_a, vector='a', justification='a'),
286288
]
287289
sorted_refs = sorted(refs)
288290
expected_refs = reorder(refs, expected_order)

0 commit comments

Comments
 (0)