Skip to content

test: improve test_csv2cve_valid_file for future failures #2548

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions test/test_csv2cve.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,17 @@ async def test_csv2cve_valid_file(self, caplog):
"Known CVEs in ('curl', '7.34.0'), ('kerberos', '1.15.1'), ('kerberos_5', '1.15.1'):",
) in caplog.record_tuples

for cve in [
"3 CVE(s) in mit.kerberos v1.15.1",
# "58 CVE(s) in haxx.curl v7.34.0", Seems to be changing right now
"10 CVE(s) in mit.kerberos_5 v1.15.1",
for cve_count, product in [
[3, "mit.kerberos v1.15.1"],
[60, "haxx.curl v7.34.0"],
[10, "mit.kerberos_5 v1.15.1"],
]:
assert (
"cve_bin_tool.CVEScanner",
logging.INFO,
cve,
) in caplog.record_tuples
retrieved_cve_count = 0
for captured_line in caplog.record_tuples:
if captured_line[2].find(product) != -1:
retrieved_cve_count = int(captured_line[2].split()[0])

assert retrieved_cve_count >= cve_count

@pytest.mark.asyncio
@pytest.mark.parametrize(
Expand Down