Skip to content

Commit

Permalink
jinja filter: test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jstucke committed Jul 5, 2024
1 parent b1cd126 commit 071c255
Showing 1 changed file with 12 additions and 19 deletions.
31 changes: 12 additions & 19 deletions src/test/unit/web_interface/test_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,40 +394,33 @@ def test_replace_cwe_with_link(input_string, expected_result):
({}, []),
( # primary key max(v2, v3) sorting
{
'cve_id1': {'score2': '6.0', 'score3': '2.0'},
'cve_id2': {'score2': '4.0', 'score3': '3.0'},
'cve_id3': {'score2': '1.0', 'score3': '5.0'},
'cve_id1': {'scores': {'V2': '6.0', 'V3.0': '2.0'}},
'cve_id2': {'scores': {'V2': '4.0', 'V3.0': '3.0'}},
'cve_id3': {'scores': {'V2': '1.0', 'V3.0': '5.0'}},
},
['cve_id1', 'cve_id3', 'cve_id2'],
),
( # numerical sorting
{
'cve_id1': {'score2': '1.3', 'score3': '0.0'},
'cve_id2': {'score2': '10.0', 'score3': '0.0'},
'cve_id3': {'score2': '2.6', 'score3': '0.0'},
'cve_id1': {'scores': {'V2': '1.3', 'V3.0': '0.0'}},
'cve_id2': {'scores': {'V2': '10.0', 'V3.0': '0.0'}},
'cve_id3': {'scores': {'V2': '2.6', 'V3.0': '0.0'}},
},
['cve_id2', 'cve_id3', 'cve_id1'],
),
( # secondary key sorting
{
'cve_id1': {'score2': '5.0', 'score3': '2.0'},
'cve_id2': {'score2': '5.0', 'score3': '3.0'},
'cve_id3': {'score2': '5.0', 'score3': '4.0'},
'cve_id1': {'scores': {'V2': '5.0', 'V3.0': '2.0'}},
'cve_id2': {'scores': {'V2': '5.0', 'V3.0': '3.0'}},
'cve_id3': {'scores': {'V2': '5.0', 'V3.0': '4.0'}},
},
['cve_id3', 'cve_id2', 'cve_id1'],
),
( # N/A entries
{
'cve_id1': {'score2': 'N/A', 'score3': '4.0'},
'cve_id2': {'score2': '3.0', 'score3': 'N/A'},
},
['cve_id1', 'cve_id2'],
),
( # missing entries
{
'cve_id1': {'score3': '1.0'},
'cve_id2': {'score2': '2.0'},
'cve_id3': {},
'cve_id1': {'scores': {'V3.0': '1.0'}},
'cve_id2': {'scores': {'V2': '2.0'}},
'cve_id3': {'scores': {}},
},
['cve_id2', 'cve_id1', 'cve_id3'],
),
Expand Down

0 comments on commit 071c255

Please sign in to comment.