@@ -651,15 +651,17 @@ async def test_pagination_token_idempotent(app_client, ctx, txn_client):
651
651
652
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 = {"ids" : [test_item ["id" ]], "fields" : "+properties.proj:epsg,+properties.gsd" }
655
656
resp = await app_client .get ("/search" , params = params )
656
657
feat_properties = resp .json ()["features" ][0 ]["properties" ]
657
658
assert not set (feat_properties ) - {"proj:epsg" , "gsd" , "datetime" }
658
659
659
660
660
661
async def test_field_extension_get_excludes (app_client , ctx ):
661
662
"""Test GET search with included fields (fields extension)"""
662
- params = {"fields" : "-properties.proj:epsg,-properties.gsd" }
663
+ test_item = ctx .item
664
+ params = {"ids" : [test_item ["id" ]], "fields" : "-properties.proj:epsg,-properties.gsd" }
663
665
resp = await app_client .get ("/search" , params = params )
664
666
resp_json = resp .json ()
665
667
assert "proj:epsg" not in resp_json ["features" ][0 ]["properties" ].keys ()
@@ -668,7 +670,9 @@ async def test_field_extension_get_excludes(app_client, ctx):
668
670
669
671
async def test_field_extension_post (app_client , ctx ):
670
672
"""Test POST search with included and excluded fields (fields extension)"""
673
+ test_item = ctx .item
671
674
body = {
675
+ "ids" : [test_item ["id" ]],
672
676
"fields" : {
673
677
"exclude" : ["assets.B1" ],
674
678
"include" : ["properties.eo:cloud_cover" , "properties.orientation" ],
@@ -687,7 +691,9 @@ async def test_field_extension_post(app_client, ctx):
687
691
688
692
async def test_field_extension_exclude_and_include (app_client , ctx ):
689
693
"""Test POST search including/excluding same field (fields extension)"""
694
+ test_item = ctx .item
690
695
body = {
696
+ "ids" : [test_item ["id" ]],
691
697
"fields" : {
692
698
"exclude" : ["properties.eo:cloud_cover" ],
693
699
"include" : ["properties.eo:cloud_cover" ],
@@ -701,7 +707,11 @@ async def test_field_extension_exclude_and_include(app_client, ctx):
701
707
702
708
async def test_field_extension_exclude_default_includes (app_client , ctx ):
703
709
"""Test POST search excluding a forbidden field (fields extension)"""
704
- body = {"fields" : {"exclude" : ["gsd" ]}}
710
+ test_item = ctx .item
711
+ body = {
712
+ "ids" : [test_item ["id" ]],
713
+ "fields" : {"exclude" : ["gsd" ]}
714
+ }
705
715
706
716
resp = await app_client .post ("/search" , json = body )
707
717
resp_json = resp .json ()
0 commit comments