@@ -258,6 +258,7 @@ async def test_item_collection_filter_datetime(app_client, ctx):
258
258
assert len (resp_json ["features" ]) == 0
259
259
260
260
261
+ @pytest .mark .asyncio
261
262
@pytest .mark .skip (reason = "Pagination extension not implemented" )
262
263
async def test_pagination (app_client , load_test_data ):
263
264
"""Test item collection pagination (paging extension)"""
@@ -384,6 +385,7 @@ async def test_item_search_temporal_window_post(app_client, ctx):
384
385
assert resp_json ["features" ][0 ]["id" ] == test_item ["id" ]
385
386
386
387
388
+ @pytest .mark .asyncio
387
389
@pytest .mark .skip (reason = "KeyError: 'features" )
388
390
async def test_item_search_temporal_open_window (app_client , ctx ):
389
391
"""Test POST search with open spatio-temporal query (core)"""
@@ -398,39 +400,6 @@ async def test_item_search_temporal_open_window(app_client, ctx):
398
400
assert resp_json ["features" ][0 ]["id" ] == test_item ["id" ]
399
401
400
402
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
-
434
403
@pytest .mark .asyncio
435
404
async def test_item_search_by_id_get (app_client , ctx , txn_client ):
436
405
"""Test GET search by item id (core)"""
@@ -498,27 +467,6 @@ async def test_item_search_temporal_window_get(app_client, ctx):
498
467
assert resp_json ["features" ][0 ]["id" ] == test_item ["id" ]
499
468
500
469
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
-
522
470
@pytest .mark .asyncio
523
471
async def test_item_search_post_without_collection (app_client , ctx ):
524
472
"""Test POST search without specifying a collection"""
@@ -742,6 +690,7 @@ async def test_field_extension_post(app_client, ctx):
742
690
}
743
691
744
692
693
+ @pytest .mark .asyncio
745
694
async def test_field_extension_exclude_and_include (app_client , ctx ):
746
695
"""Test POST search including/excluding same field (fields extension)"""
747
696
test_item = ctx .item
@@ -758,6 +707,7 @@ async def test_field_extension_exclude_and_include(app_client, ctx):
758
707
assert "eo:cloud_cover" not in resp_json ["features" ][0 ]["properties" ]
759
708
760
709
710
+ @pytest .mark .asyncio
761
711
async def test_field_extension_exclude_default_includes (app_client , ctx ):
762
712
"""Test POST search excluding a forbidden field (fields extension)"""
763
713
test_item = ctx .item
@@ -768,6 +718,7 @@ async def test_field_extension_exclude_default_includes(app_client, ctx):
768
718
assert "gsd" not in resp_json ["features" ][0 ]
769
719
770
720
721
+ @pytest .mark .asyncio
771
722
async def test_search_intersects_and_bbox (app_client ):
772
723
"""Test POST search intersects and bbox are mutually exclusive (core)"""
773
724
bbox = [- 118 , 34 , - 117 , 35 ]
@@ -777,20 +728,23 @@ async def test_search_intersects_and_bbox(app_client):
777
728
assert resp .status_code == 400
778
729
779
730
731
+ @pytest .mark .asyncio
780
732
async def test_get_missing_item (app_client , load_test_data ):
781
733
"""Test read item which does not exist (transactions extension)"""
782
734
test_coll = load_test_data ("test_collection.json" )
783
735
resp = await app_client .get (f"/collections/{ test_coll ['id' ]} /items/invalid-item" )
784
736
assert resp .status_code == 404
785
737
786
738
739
+ @pytest .mark .asyncio
787
740
@pytest .mark .skip (reason = "invalid queries not implemented" )
788
741
async def test_search_invalid_query_field (app_client ):
789
742
body = {"query" : {"gsd" : {"lt" : 100 }, "invalid-field" : {"eq" : 50 }}}
790
743
resp = await app_client .post ("/search" , json = body )
791
744
assert resp .status_code == 400
792
745
793
746
747
+ @pytest .mark .asyncio
794
748
async def test_search_bbox_errors (app_client ):
795
749
body = {"query" : {"bbox" : [0 ]}}
796
750
resp = await app_client .post ("/search" , json = body )
@@ -805,6 +759,7 @@ async def test_search_bbox_errors(app_client):
805
759
assert resp .status_code == 400
806
760
807
761
762
+ @pytest .mark .asyncio
808
763
async def test_conformance_classes_configurable ():
809
764
"""Test conformance class configurability"""
810
765
landing = LandingPageMixin ()
@@ -822,6 +777,7 @@ async def test_conformance_classes_configurable():
822
777
assert client .conformance_classes ()[0 ] == "this is a test"
823
778
824
779
780
+ @pytest .mark .asyncio
825
781
async def test_search_datetime_validation_errors (app_client ):
826
782
bad_datetimes = [
827
783
"37-01-01T12:00:27.87Z" ,
0 commit comments