@@ -258,6 +258,7 @@ async def test_item_collection_filter_datetime(app_client, ctx):
258258 assert len (resp_json ["features" ]) == 0
259259
260260
261+ @pytest .mark .asyncio
261262@pytest .mark .skip (reason = "Pagination extension not implemented" )
262263async def test_pagination (app_client , load_test_data ):
263264 """Test item collection pagination (paging extension)"""
@@ -384,6 +385,7 @@ async def test_item_search_temporal_window_post(app_client, ctx):
384385 assert resp_json ["features" ][0 ]["id" ] == test_item ["id" ]
385386
386387
388+ @pytest .mark .asyncio
387389@pytest .mark .skip (reason = "KeyError: 'features" )
388390async def test_item_search_temporal_open_window (app_client , ctx ):
389391 """Test POST search with open spatio-temporal query (core)"""
@@ -398,39 +400,6 @@ async def test_item_search_temporal_open_window(app_client, ctx):
398400 assert resp_json ["features" ][0 ]["id" ] == test_item ["id" ]
399401
400402
401- @pytest .mark .skip (reason = "sortby date not implemented" )
402- async def test_item_search_sort_post (app_client , load_test_data ):
403- """Test POST search with sorting (sort extension)"""
404- first_item = load_test_data ("test_item.json" )
405- item_date = rfc3339_str_to_datetime (first_item ["properties" ]["datetime" ])
406- resp = await app_client .post (
407- f"/collections/{ first_item ['collection' ]} /items" , json = first_item
408- )
409- assert resp .status_code == 200
410-
411- second_item = load_test_data ("test_item.json" )
412- second_item ["id" ] = "another-item"
413- another_item_date = item_date - timedelta (days = 1 )
414- second_item ["properties" ]["datetime" ] = datetime_to_str (another_item_date )
415- resp = await app_client .post (
416- f"/collections/{ second_item ['collection' ]} /items" , json = second_item
417- )
418- assert resp .status_code == 200
419-
420- params = {
421- "collections" : [first_item ["collection" ]],
422- "sortby" : [{"field" : "datetime" , "direction" : "desc" }],
423- }
424- resp = await app_client .post ("/search" , json = params )
425- assert resp .status_code == 200
426- resp_json = resp .json ()
427- assert resp_json ["features" ][0 ]["id" ] == first_item ["id" ]
428- assert resp_json ["features" ][1 ]["id" ] == second_item ["id" ]
429- await app_client .delete (
430- f"/collections/{ first_item ['collection' ]} /items/{ first_item ['id' ]} "
431- )
432-
433-
434403@pytest .mark .asyncio
435404async def test_item_search_by_id_get (app_client , ctx , txn_client ):
436405 """Test GET search by item id (core)"""
@@ -498,27 +467,6 @@ async def test_item_search_temporal_window_get(app_client, ctx):
498467 assert resp_json ["features" ][0 ]["id" ] == test_item ["id" ]
499468
500469
501- @pytest .mark .skip (reason = "sorting not fully implemented" )
502- async def test_item_search_sort_get (app_client , ctx , txn_client ):
503- """Test GET search with sorting (sort extension)"""
504- first_item = ctx .item
505- item_date = rfc3339_str_to_datetime (first_item ["properties" ]["datetime" ])
506- await create_item (txn_client , ctx .item )
507-
508- second_item = ctx .item .copy ()
509- second_item ["id" ] = "another-item"
510- another_item_date = item_date - timedelta (days = 1 )
511- second_item .update ({"properties" : {"datetime" : datetime_to_str (another_item_date )}})
512- await create_item (txn_client , second_item )
513-
514- params = {"collections" : [first_item ["collection" ]], "sortby" : "-datetime" }
515- resp = await app_client .get ("/search" , params = params )
516- assert resp .status_code == 200
517- resp_json = resp .json ()
518- assert resp_json ["features" ][0 ]["id" ] == first_item ["id" ]
519- assert resp_json ["features" ][1 ]["id" ] == second_item ["id" ]
520-
521-
522470@pytest .mark .asyncio
523471async def test_item_search_post_without_collection (app_client , ctx ):
524472 """Test POST search without specifying a collection"""
@@ -742,6 +690,7 @@ async def test_field_extension_post(app_client, ctx):
742690 }
743691
744692
693+ @pytest .mark .asyncio
745694async def test_field_extension_exclude_and_include (app_client , ctx ):
746695 """Test POST search including/excluding same field (fields extension)"""
747696 test_item = ctx .item
@@ -758,6 +707,7 @@ async def test_field_extension_exclude_and_include(app_client, ctx):
758707 assert "eo:cloud_cover" not in resp_json ["features" ][0 ]["properties" ]
759708
760709
710+ @pytest .mark .asyncio
761711async def test_field_extension_exclude_default_includes (app_client , ctx ):
762712 """Test POST search excluding a forbidden field (fields extension)"""
763713 test_item = ctx .item
@@ -768,6 +718,7 @@ async def test_field_extension_exclude_default_includes(app_client, ctx):
768718 assert "gsd" not in resp_json ["features" ][0 ]
769719
770720
721+ @pytest .mark .asyncio
771722async def test_search_intersects_and_bbox (app_client ):
772723 """Test POST search intersects and bbox are mutually exclusive (core)"""
773724 bbox = [- 118 , 34 , - 117 , 35 ]
@@ -777,20 +728,23 @@ async def test_search_intersects_and_bbox(app_client):
777728 assert resp .status_code == 400
778729
779730
731+ @pytest .mark .asyncio
780732async def test_get_missing_item (app_client , load_test_data ):
781733 """Test read item which does not exist (transactions extension)"""
782734 test_coll = load_test_data ("test_collection.json" )
783735 resp = await app_client .get (f"/collections/{ test_coll ['id' ]} /items/invalid-item" )
784736 assert resp .status_code == 404
785737
786738
739+ @pytest .mark .asyncio
787740@pytest .mark .skip (reason = "invalid queries not implemented" )
788741async def test_search_invalid_query_field (app_client ):
789742 body = {"query" : {"gsd" : {"lt" : 100 }, "invalid-field" : {"eq" : 50 }}}
790743 resp = await app_client .post ("/search" , json = body )
791744 assert resp .status_code == 400
792745
793746
747+ @pytest .mark .asyncio
794748async def test_search_bbox_errors (app_client ):
795749 body = {"query" : {"bbox" : [0 ]}}
796750 resp = await app_client .post ("/search" , json = body )
@@ -805,6 +759,7 @@ async def test_search_bbox_errors(app_client):
805759 assert resp .status_code == 400
806760
807761
762+ @pytest .mark .asyncio
808763async def test_conformance_classes_configurable ():
809764 """Test conformance class configurability"""
810765 landing = LandingPageMixin ()
@@ -822,6 +777,7 @@ async def test_conformance_classes_configurable():
822777 assert client .conformance_classes ()[0 ] == "this is a test"
823778
824779
780+ @pytest .mark .asyncio
825781async def test_search_datetime_validation_errors (app_client ):
826782 bad_datetimes = [
827783 "37-01-01T12:00:27.87Z" ,
0 commit comments