From 63d99b6506b35aa659838f249462e197fe78b54b Mon Sep 17 00:00:00 2001 From: vincentsarago Date: Thu, 1 Aug 2024 16:06:28 +0200 Subject: [PATCH] more tests and update changelog --- CHANGES.md | 2 ++ tests/resources/test_collection.py | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index ccae3f3..8356053 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,8 @@ ## [Unreleased] +- Enable filter extension for `GET /items` requests and add `Queryables` links in `/collections` and `/collections/{collection_id}` responses ([#89](https://github.com/stac-utils/stac-fastapi-pgstac/pull/89)) + ## [3.0.0a4] - 2024-07-10 - Update stac-fastapi libraries to `~=3.0.0b2` diff --git a/tests/resources/test_collection.py b/tests/resources/test_collection.py index ff5c8ad..3a2183b 100644 --- a/tests/resources/test_collection.py +++ b/tests/resources/test_collection.py @@ -260,3 +260,19 @@ async def test_get_collections_forwarded_header(app_client, load_test_collection ) for link in resp.json()["links"]: assert link["href"].startswith("https://test:1234/") + + +@pytest.mark.asyncio +async def test_get_collections_queryables_links(app_client, load_test_collection): + resp = await app_client.get( + "/collections", + ) + assert "Queryables" in [ + link.get("title") for link in resp.json()["collections"][0]["links"] + ] + + collection_id = resp.json()["collections"][0]["id"] + resp = await app_client.get( + f"/collections/{collection_id}", + ) + assert "Queryables" in [link.get("title") for link in resp.json()["links"]]