Skip to content

Commit 66be514

Browse files
committed
add another collection extensions test
1 parent d2104af commit 66be514

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

stac_fastapi/tests/resources/test_collection.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,26 @@ async def test_returns_valid_collection(ctx, app_client):
107107
collection.validate()
108108

109109

110-
@pytest.mark.skip(reason="Broken as of stac-fastapi v2.5.5")
111110
@pytest.mark.asyncio
112111
async def test_collection_extensions(ctx, app_client):
112+
"""Test that extensions can be used to define additional top-level properties"""
113+
ctx.collection.get("stac_extensions", []).append(
114+
"https://stac-extensions.github.io/item-assets/v1.0.0/schema.json"
115+
)
116+
test_asset = {"title": "test", "description": "test", "type": "test"}
117+
ctx.collection["item_assets"] = {"test": test_asset}
118+
ctx.collection["id"] = "test-item-assets"
119+
resp = await app_client.post("/collections", json=ctx.collection)
120+
121+
assert resp.status_code == 200
122+
assert resp.json().get("item_assets", {}).get("test") == test_asset
123+
124+
125+
@pytest.mark.skip(
126+
reason="Broken as of stac-fastapi v2.5.5, the PUT collections route is not allowing the item_assets field to persist."
127+
)
128+
@pytest.mark.asyncio
129+
async def test_collection_extensions_with_put(ctx, app_client):
113130
"""Test that extensions can be used to define additional top-level properties"""
114131
ctx.collection.get("stac_extensions", []).append(
115132
"https://stac-extensions.github.io/item-assets/v1.0.0/schema.json"

0 commit comments

Comments
 (0)