Skip to content

Commit 4573472

Browse files
committed
add free-text test to test_api.py
1 parent 5f67ec9 commit 4573472

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/api/test_api.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,20 @@ async def test_get_collections_search(
548548
assert resp.json()["collections"][1]["id"] == load_test_collection["id"]
549549
assert resp.json()["collections"][0]["id"] == load_test2_collection.id
550550

551+
# free-text
552+
resp = await app_client.get(
553+
"/collections",
554+
params={"q": "temperature"},
555+
)
556+
assert len(resp.json()["collections"]) == 1
557+
assert resp.json()["collections"][0]["id"] == load_test2_collection.id
558+
559+
resp = await app_client.get(
560+
"/collections",
561+
params={"q": "nosuchthing"},
562+
)
563+
assert len(resp.json()["collections"]) == 0
564+
551565

552566
@pytest.mark.asyncio
553567
async def test_item_collection_filter_bbox(

0 commit comments

Comments
 (0)