|
17 | 17 | # SPDX-License-Identifier: Apache-2.0
|
18 | 18 | # Copyright (c) OWASP Foundation. All Rights Reserved.
|
19 | 19 |
|
| 20 | +from decimal import Decimal |
20 | 21 | import unittest
|
21 | 22 | from unittest import TestCase
|
22 | 23 | from unittest.mock import Mock, patch
|
@@ -272,17 +273,18 @@ def test_sort(self) -> None:
|
272 | 273 | # expected sort order: ([severity], [score], [source], [method], [vector], [justification])
|
273 | 274 | expected_order = [0, 1, 2, 3, 4, 5, 6, 7]
|
274 | 275 | 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), |
278 | 279 | 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)), |
282 | 284 | 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'), |
286 | 288 | ]
|
287 | 289 | sorted_refs = sorted(refs)
|
288 | 290 | expected_refs = reorder(refs, expected_order)
|
|
0 commit comments