Skip to content

Commit 367d415

Browse files
committed
handle feature collection
1 parent 963b452 commit 367d415

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

stac_fastapi/elasticsearch/tests/conftest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,10 @@ async def create_collection(txn_client: TransactionsClient, collection: Dict) ->
9494

9595

9696
async def create_item(txn_client: TransactionsClient, item: Dict) -> None:
97-
await txn_client.create_item(item, request=MockRequest, refresh=True)
98-
97+
if 'collection' in item:
98+
await txn_client.create_item(collection_id=item["collection"], item=item, request=MockRequest, refresh=True)
99+
else:
100+
await txn_client.create_item(collection_id=item['features'][0]["collection"], item=item, request=MockRequest, refresh=True)
99101

100102
async def delete_collections_and_items(txn_client: TransactionsClient) -> None:
101103
await refresh_indices(txn_client)

0 commit comments

Comments
 (0)