diff --git a/tests/test_api.py b/tests/test_api.py index 6635b261..85e762ac 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -62,32 +62,30 @@ async def test_upload_path(client, db): record = asyncio.run(db.invocations.find_one()) assert record is not None, "Saved invocation not found" saved_invocation = Invocation(**record) - assert saved_invocation["id"] == SAMPLE_INV.id, "IDs do not match" + assert saved_invocation.id == SAMPLE_INV.id, "IDs do not match" assert ( - saved_invocation["work"]["filename"] == SAMPLE_INV.work.filename + saved_invocation.work.filename == SAMPLE_INV.work.filename ), "Work data does not match" assert ( - saved_invocation["client"]["compute_context_id"] + saved_invocation.client.compute_context_id == SAMPLE_INV.client.compute_context_id ), "Client data does not match" assert ( - saved_invocation["osm_version"] == SAMPLE_INV.osm_version + saved_invocation.osm_version == SAMPLE_INV.osm_version ), "OSM version does not match" assert ( - saved_invocation["user_comment"] == SAMPLE_INV.user_comment + saved_invocation.user_comment == SAMPLE_INV.user_comment ), "User comment does not match" assert ( - saved_invocation["components"][0]["name"] == SAMPLE_INV.components[0].name + saved_invocation.components[0].name == SAMPLE_INV.components[0].name ), "Component name does not match" assert ( - saved_invocation["components"][0]["version"] == SAMPLE_INV.components[0].version + saved_invocation.components[0].version == SAMPLE_INV.components[0].version ), "Component version does not match" - assert saved_invocation["funder"] == SAMPLE_INV.funder, "Funder does not match" - assert ( - saved_invocation["data_tags"] == SAMPLE_INV.data_tags - ), "Data tags do not match" + assert saved_invocation.funder == SAMPLE_INV.funder, "Funder does not match" + assert saved_invocation.data_tags == SAMPLE_INV.data_tags, "Data tags do not match" # TODO: fix tzinfo issue breakpoint() assert ( - saved_invocation["created_at"] == SAMPLE_INV.created_at + saved_invocation.created_at == SAMPLE_INV.created_at ), "Created at does not match"