Skip to content

Commit 1db1187

Browse files
committed
unskip 4 more tests
1 parent 04a6b01 commit 1db1187

File tree

1 file changed

+3
-31
lines changed

1 file changed

+3
-31
lines changed

stac_fastapi/elasticsearch/tests/resources/test_item.py

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -649,39 +649,25 @@ async def test_pagination_token_idempotent(app_client, ctx, txn_client):
649649
]
650650

651651

652-
async def test_field_extension_get_includes(app_client, ctx):
652+
async def test_field_extension_get_includes(app_client):
653653
"""Test GET search with included fields (fields extension)"""
654654
params = {"fields": "+properties.proj:epsg,+properties.gsd"}
655655
resp = await app_client.get("/search", params=params)
656656
feat_properties = resp.json()["features"][0]["properties"]
657657
assert not set(feat_properties) - {"proj:epsg", "gsd", "datetime"}
658658

659659

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):
662661
"""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-
669662
params = {"fields": "-properties.proj:epsg,-properties.gsd"}
670663
resp = await app_client.get("/search", params=params)
671664
resp_json = resp.json()
672665
assert "proj:epsg" not in resp_json["features"][0]["properties"].keys()
673666
assert "gsd" not in resp_json["features"][0]["properties"].keys()
674667

675668

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):
678670
"""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-
685671
body = {
686672
"fields": {
687673
"exclude": ["assets.B1"],
@@ -699,15 +685,8 @@ async def test_field_extension_post(app_client, load_test_data):
699685
}
700686

701687

702-
@pytest.mark.skip(reason="fields not implemented")
703688
async def test_field_extension_exclude_and_include(app_client, load_test_data):
704689
"""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-
711690
body = {
712691
"fields": {
713692
"exclude": ["properties.eo:cloud_cover"],
@@ -720,15 +699,8 @@ async def test_field_extension_exclude_and_include(app_client, load_test_data):
720699
assert "eo:cloud_cover" not in resp_json["features"][0]["properties"]
721700

722701

723-
@pytest.mark.skip(reason="fields not implemented")
724702
async def test_field_extension_exclude_default_includes(app_client, load_test_data):
725703
"""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-
732704
body = {"fields": {"exclude": ["gsd"]}}
733705

734706
resp = await app_client.post("/search", json=body)

0 commit comments

Comments
 (0)