Skip to content

Commit

Permalink
test: add test for OdkEntity.getEntity method
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Apr 15, 2024
1 parent 754d8ce commit c830632
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/test_entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,19 @@ async def test_get_entity_data_select_params(odk_entity_cleanup):
assert "__id" in first_entity, "Missing '__id' key"
assert "__system" in first_entity and "updatedAt" in first_entity["__system"], "Missing '__system/updatedAt' key"
assert "geometry" in first_entity, "Missing 'geometry' key"


async def test_get_single_entity(odk_entity_cleanup):
"""Test getting specific Entity by UUID."""
odk_id, dataset_name, entity_uuid, entity = odk_entity_cleanup
async with entity:
single_entity = await entity.getEntity(
odk_id,
dataset_name,
entity_uuid,
)

assert single_entity.get("uuid") == entity_uuid
entity_info = single_entity.get("currentVersion")
assert entity_info.get("label") == "test entity"
assert entity_info.get("data", {}).get("osm_id") == "1"

0 comments on commit c830632

Please sign in to comment.