Skip to content

Commit a915f2a

Browse files
committed
Add test for collections fields extension
1 parent cc723ee commit a915f2a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/api/test_api.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,18 @@ async def test_app_query_extension_gte(load_test_data, app_client, load_test_col
271271
assert len(resp_json["features"]) == 1
272272

273273

274+
async def test_app_collection_fields_extension(
275+
load_test_data, app_client, load_test_collection
276+
):
277+
fields = ["id", "title"]
278+
resp = await app_client.get("/collections", params={"fields": ",".join(fields)})
279+
assert resp.status_code == 200
280+
resp_json = resp.json()
281+
resp_collections = resp_json["collections"]
282+
assert len(resp_collections) > 0
283+
assert all(set(collection.keys()) == set(fields) for collection in resp_collections)
284+
285+
274286
async def test_app_sort_extension(load_test_data, app_client, load_test_collection):
275287
coll = load_test_collection
276288
first_item = load_test_data("test_item.json")

0 commit comments

Comments
 (0)