File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
stac_fastapi/tests/database Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 25
25
@pytest .mark .asyncio
26
26
async def test_index_mapping_collections (ctx ):
27
27
response = await database .client .indices .get_mapping (index = COLLECTIONS_INDEX )
28
- actual_mappings = next (iter (response .body .values ()))["mappings" ]
28
+ if not isinstance (response , dict ):
29
+ response = response .body
30
+ actual_mappings = next (iter (response .values ()))["mappings" ]
29
31
assert (
30
32
actual_mappings ["dynamic_templates" ]
31
33
== ES_COLLECTIONS_MAPPINGS ["dynamic_templates" ]
@@ -40,7 +42,9 @@ async def test_index_mapping_items(ctx, txn_client):
40
42
response = await database .client .indices .get_mapping (
41
43
index = index_by_collection_id (collection ["id" ])
42
44
)
43
- actual_mappings = next (iter (response .body .values ()))["mappings" ]
45
+ if not isinstance (response , dict ):
46
+ response = response .body
47
+ actual_mappings = next (iter (response .values ()))["mappings" ]
44
48
assert (
45
49
actual_mappings ["dynamic_templates" ] == ES_ITEMS_MAPPINGS ["dynamic_templates" ]
46
50
)
You can’t perform that action at this time.
0 commit comments