Skip to content

Commit

Permalink
Implement tests with and without schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
felddy committed Aug 29, 2024
1 parent 7952346 commit 21a1db0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/test_kevsync.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,22 @@ async def test_connection_motor(db_uri, db_name):
assert server_info["ok"] == 1.0, "Direct database ping failed"


async def test_fetch_kev_data():
async def test_fetch_kev_data_without_schema():
kev_data = await fetch_kev_data(DEFAULT_KEV_URL)
assert "vulnerabilities" in kev_data, "Expected 'vulnerabilities' in KEV data"
assert (
len(kev_data["vulnerabilities"]) > 0
), "Expected at least one vulnerability item in KEV data"


async def test_fetch_kev_data_with_schema():
kev_data = await fetch_kev_data(DEFAULT_KEV_URL, DEFAULT_KEV_SCHEMA_URL)
assert "vulnerabilities" in kev_data, "Expected 'vulnerabilities' in KEV data"
assert (
len(kev_data["vulnerabilities"]) > 0
), "Expected at least one vulnerability item in KEV data"


async def test_create_kev_doc():
await create_kev_doc(VULN_1)
# Attempt to find the newly created document
Expand Down

0 comments on commit 21a1db0

Please sign in to comment.