Skip to content

Commit 7280ba9

Browse files
authored
test: improve test_csv2cve_valid_file for future failures (#2548)
* closes #2532
1 parent a5c5197 commit 7280ba9

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

test/test_csv2cve.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,17 @@ async def test_csv2cve_valid_file(self, caplog):
3030
"Known CVEs in ('curl', '7.34.0'), ('kerberos', '1.15.1'), ('kerberos_5', '1.15.1'):",
3131
) in caplog.record_tuples
3232

33-
for cve in [
34-
"3 CVE(s) in mit.kerberos v1.15.1",
35-
# "58 CVE(s) in haxx.curl v7.34.0", Seems to be changing right now
36-
"10 CVE(s) in mit.kerberos_5 v1.15.1",
33+
for cve_count, product in [
34+
[3, "mit.kerberos v1.15.1"],
35+
[60, "haxx.curl v7.34.0"],
36+
[10, "mit.kerberos_5 v1.15.1"],
3737
]:
38-
assert (
39-
"cve_bin_tool.CVEScanner",
40-
logging.INFO,
41-
cve,
42-
) in caplog.record_tuples
38+
retrieved_cve_count = 0
39+
for captured_line in caplog.record_tuples:
40+
if captured_line[2].find(product) != -1:
41+
retrieved_cve_count = int(captured_line[2].split()[0])
42+
43+
assert retrieved_cve_count >= cve_count
4344

4445
@pytest.mark.asyncio
4546
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)