Commit 0df2982
fix: Add missing comparator for VulnerabilityAnalysis (#812)
When trying to generate a CycloneDX BOM that has two vulnerabilities
that only differ in their analysis, you get
```
TypeError: '<' not supported between instances of 'VulnerabilityAnalysis' and 'VulnerabilityAnalysis'
```
This PR adds the `__lt__` method for the VulnerabilityAnalysis model to
fix sorting and also includes a test case to verify the fix.
---------
Signed-off-by: Riku Häkli <hakli.riku@gmail.com>
Co-authored-by: Riku Häkli <hakli.riku@gmail.com>1 parent 036eb76 commit 0df2982
File tree
2 files changed
+33
-1
lines changed- cyclonedx/model
- tests
2 files changed
+33
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
352 | 357 | | |
353 | 358 | | |
354 | 359 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
24 | 29 | | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
28 | 33 | | |
| 34 | + | |
29 | 35 | | |
30 | 36 | | |
31 | 37 | | |
| |||
334 | 340 | | |
335 | 341 | | |
336 | 342 | | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
0 commit comments