@@ -260,7 +260,7 @@ async def test_pagination(app_client, load_test_data):
260
260
assert second_page ["context" ]["returned" ] == 3
261
261
262
262
263
- async def test_item_timestamps (app_client , ctx , load_test_data ):
263
+ async def test_item_timestamps (app_client , ctx ):
264
264
"""Test created and updated timestamps (common metadata)"""
265
265
# start_time = now_to_rfc3339_str()
266
266
@@ -335,7 +335,7 @@ async def test_item_search_temporal_query_post(app_client, ctx):
335
335
assert resp_json ["features" ][0 ]["id" ] == test_item ["id" ]
336
336
337
337
338
- async def test_item_search_temporal_window_post (app_client , load_test_data , ctx ):
338
+ async def test_item_search_temporal_window_post (app_client , ctx ):
339
339
"""Test POST search with two-tailed spatio-temporal query (core)"""
340
340
test_item = ctx .item
341
341
@@ -649,30 +649,40 @@ async def test_pagination_token_idempotent(app_client, ctx, txn_client):
649
649
]
650
650
651
651
652
- async def test_field_extension_get_includes (app_client ):
652
+ async def test_field_extension_get_includes (app_client , ctx ):
653
653
"""Test GET search with included fields (fields extension)"""
654
- params = {"fields" : "+properties.proj:epsg,+properties.gsd" }
654
+ test_item = ctx .item
655
+ params = {
656
+ "ids" : [test_item ["id" ]],
657
+ "fields" : "+properties.proj:epsg,+properties.gsd" ,
658
+ }
655
659
resp = await app_client .get ("/search" , params = params )
656
660
feat_properties = resp .json ()["features" ][0 ]["properties" ]
657
661
assert not set (feat_properties ) - {"proj:epsg" , "gsd" , "datetime" }
658
662
659
663
660
- async def test_field_extension_get_excludes (app_client ):
664
+ async def test_field_extension_get_excludes (app_client , ctx ):
661
665
"""Test GET search with included fields (fields extension)"""
662
- params = {"fields" : "-properties.proj:epsg,-properties.gsd" }
666
+ test_item = ctx .item
667
+ params = {
668
+ "ids" : [test_item ["id" ]],
669
+ "fields" : "-properties.proj:epsg,-properties.gsd" ,
670
+ }
663
671
resp = await app_client .get ("/search" , params = params )
664
672
resp_json = resp .json ()
665
673
assert "proj:epsg" not in resp_json ["features" ][0 ]["properties" ].keys ()
666
674
assert "gsd" not in resp_json ["features" ][0 ]["properties" ].keys ()
667
675
668
676
669
- async def test_field_extension_post (app_client ):
677
+ async def test_field_extension_post (app_client , ctx ):
670
678
"""Test POST search with included and excluded fields (fields extension)"""
679
+ test_item = ctx .item
671
680
body = {
681
+ "ids" : [test_item ["id" ]],
672
682
"fields" : {
673
683
"exclude" : ["assets.B1" ],
674
684
"include" : ["properties.eo:cloud_cover" , "properties.orientation" ],
675
- }
685
+ },
676
686
}
677
687
678
688
resp = await app_client .post ("/search" , json = body )
@@ -685,23 +695,26 @@ async def test_field_extension_post(app_client):
685
695
}
686
696
687
697
688
- async def test_field_extension_exclude_and_include (app_client , load_test_data ):
698
+ async def test_field_extension_exclude_and_include (app_client , ctx ):
689
699
"""Test POST search including/excluding same field (fields extension)"""
700
+ test_item = ctx .item
690
701
body = {
702
+ "ids" : [test_item ["id" ]],
691
703
"fields" : {
692
704
"exclude" : ["properties.eo:cloud_cover" ],
693
705
"include" : ["properties.eo:cloud_cover" ],
694
- }
706
+ },
695
707
}
696
708
697
709
resp = await app_client .post ("/search" , json = body )
698
710
resp_json = resp .json ()
699
711
assert "eo:cloud_cover" not in resp_json ["features" ][0 ]["properties" ]
700
712
701
713
702
- async def test_field_extension_exclude_default_includes (app_client , load_test_data ):
714
+ async def test_field_extension_exclude_default_includes (app_client , ctx ):
703
715
"""Test POST search excluding a forbidden field (fields extension)"""
704
- body = {"fields" : {"exclude" : ["gsd" ]}}
716
+ test_item = ctx .item
717
+ body = {"ids" : [test_item ["id" ]], "fields" : {"exclude" : ["gsd" ]}}
705
718
706
719
resp = await app_client .post ("/search" , json = body )
707
720
resp_json = resp .json ()
0 commit comments