Skip to content

Commit 1a64dc9

Browse files
committed
add two more fields tests
1 parent 8579a65 commit 1a64dc9

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

stac_fastapi/elasticsearch/tests/api/test_api.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,28 @@ async def test_app_fields_extension(app_client, ctx, txn_client):
115115
assert list(resp_json["features"][0]["properties"]) == ["datetime"]
116116

117117

118+
async def test_app_fields_extension_no_properties_get(app_client, ctx, txn_client):
119+
resp = await app_client.get(
120+
"/search", params={"collections": ["test-collection"], "fields": "-properties"}
121+
)
122+
assert resp.status_code == 200
123+
resp_json = resp.json()
124+
assert "properties" not in resp_json["features"][0]
125+
126+
127+
async def test_app_fields_extension_no_properties_post(app_client, ctx, txn_client):
128+
resp = await app_client.post(
129+
"/search",
130+
json={
131+
"collections": ["test-collection"],
132+
"fields": {"exclude": ["properties"]},
133+
},
134+
)
135+
assert resp.status_code == 200
136+
resp_json = resp.json()
137+
assert "properties" not in resp_json["features"][0]
138+
139+
118140
async def test_app_fields_extension_return_all_properties(app_client, ctx, txn_client):
119141
item = ctx.item
120142
resp = await app_client.get(

0 commit comments

Comments
 (0)