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 2525@pytest .mark .asyncio
2626async def test_index_mapping_collections (ctx ):
2727 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" ]
2931 assert (
3032 actual_mappings ["dynamic_templates" ]
3133 == ES_COLLECTIONS_MAPPINGS ["dynamic_templates" ]
@@ -40,7 +42,9 @@ async def test_index_mapping_items(ctx, txn_client):
4042 response = await database .client .indices .get_mapping (
4143 index = index_by_collection_id (collection ["id" ])
4244 )
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" ]
4448 assert (
4549 actual_mappings ["dynamic_templates" ] == ES_ITEMS_MAPPINGS ["dynamic_templates" ]
4650 )
You can’t perform that action at this time.
0 commit comments