File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
stac_fastapi/elasticsearch/tests/clients Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -289,6 +289,32 @@ def test_bulk_item_insert(
289
289
# item["id"], item["collection"], request=MockStarletteRequest
290
290
# )
291
291
292
+ def test_feature_collection_insert (
293
+ es_core : CoreCrudClient ,
294
+ es_transactions : TransactionsClient ,
295
+ es_bulk_transactions : BulkTransactionsClient ,
296
+ load_test_data : Callable ,
297
+ ):
298
+ coll = load_test_data ("test_collection.json" )
299
+ es_transactions .create_collection (coll , request = MockStarletteRequest )
300
+
301
+ item = load_test_data ("test_item.json" )
302
+
303
+ features = []
304
+ for _ in range (10 ):
305
+ _item = deepcopy (item )
306
+ _item ["id" ] = str (uuid .uuid4 ())
307
+ features .append (_item )
308
+
309
+ feature_collection = {
310
+ "type" : "FeatureCollection" ,
311
+ "features" : features
312
+ }
313
+
314
+ es_transactions .create_item (feature_collection , request = MockStarletteRequest )
315
+ time .sleep (3 )
316
+ fc = es_core .item_collection (coll ["id" ], request = MockStarletteRequest )
317
+ assert len (fc ["features" ]) >= 10
292
318
293
319
@pytest .mark .skip (reason = "Not working" )
294
320
def test_landing_page_no_collection_title (
You can’t perform that action at this time.
0 commit comments