@@ -649,39 +649,25 @@ 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 , ctx ):
652
+ async def test_field_extension_get_includes (app_client ):
653
653
"""Test GET search with included fields (fields extension)"""
654
654
params = {"fields" : "+properties.proj:epsg,+properties.gsd" }
655
655
resp = await app_client .get ("/search" , params = params )
656
656
feat_properties = resp .json ()["features" ][0 ]["properties" ]
657
657
assert not set (feat_properties ) - {"proj:epsg" , "gsd" , "datetime" }
658
658
659
659
660
- @pytest .mark .skip (reason = "fields not implemented" )
661
- async def test_field_extension_get_excludes (app_client , load_test_data ):
660
+ async def test_field_extension_get_excludes (app_client ):
662
661
"""Test GET search with included fields (fields extension)"""
663
- test_item = load_test_data ("test_item.json" )
664
- resp = await app_client .post (
665
- f"/collections/{ test_item ['collection' ]} /items" , json = test_item
666
- )
667
- assert resp .status_code == 200
668
-
669
662
params = {"fields" : "-properties.proj:epsg,-properties.gsd" }
670
663
resp = await app_client .get ("/search" , params = params )
671
664
resp_json = resp .json ()
672
665
assert "proj:epsg" not in resp_json ["features" ][0 ]["properties" ].keys ()
673
666
assert "gsd" not in resp_json ["features" ][0 ]["properties" ].keys ()
674
667
675
668
676
- @pytest .mark .skip (reason = "fields not implemented" )
677
- async def test_field_extension_post (app_client , load_test_data ):
669
+ async def test_field_extension_post (app_client ):
678
670
"""Test POST search with included and excluded fields (fields extension)"""
679
- test_item = load_test_data ("test_item.json" )
680
- resp = await app_client .post (
681
- f"/collections/{ test_item ['collection' ]} /items" , json = test_item
682
- )
683
- assert resp .status_code == 200
684
-
685
671
body = {
686
672
"fields" : {
687
673
"exclude" : ["assets.B1" ],
@@ -699,15 +685,8 @@ async def test_field_extension_post(app_client, load_test_data):
699
685
}
700
686
701
687
702
- @pytest .mark .skip (reason = "fields not implemented" )
703
688
async def test_field_extension_exclude_and_include (app_client , load_test_data ):
704
689
"""Test POST search including/excluding same field (fields extension)"""
705
- test_item = load_test_data ("test_item.json" )
706
- resp = await app_client .post (
707
- f"/collections/{ test_item ['collection' ]} /items" , json = test_item
708
- )
709
- assert resp .status_code == 200
710
-
711
690
body = {
712
691
"fields" : {
713
692
"exclude" : ["properties.eo:cloud_cover" ],
@@ -720,15 +699,8 @@ async def test_field_extension_exclude_and_include(app_client, load_test_data):
720
699
assert "eo:cloud_cover" not in resp_json ["features" ][0 ]["properties" ]
721
700
722
701
723
- @pytest .mark .skip (reason = "fields not implemented" )
724
702
async def test_field_extension_exclude_default_includes (app_client , load_test_data ):
725
703
"""Test POST search excluding a forbidden field (fields extension)"""
726
- test_item = load_test_data ("test_item.json" )
727
- resp = await app_client .post (
728
- f"/collections/{ test_item ['collection' ]} /items" , json = test_item
729
- )
730
- assert resp .status_code == 200
731
-
732
704
body = {"fields" : {"exclude" : ["gsd" ]}}
733
705
734
706
resp = await app_client .post ("/search" , json = body )
0 commit comments