Skip to content

Commit

Permalink
Merge pull request #237 from stac-utils/stac-fastapi-2.5.5
Browse files Browse the repository at this point in the history
Upgrade to stac-fastapi v2.5.5
  • Loading branch information
jonhealy1 authored May 4, 2024
2 parents 9bbf03b + 66be514 commit f1839d3
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

- Added option to include Basic Auth [#232](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/232)

### Changed

- Upgrade stac-fastapi libaries to v2.5.5 [#237](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/237)

### Fixed

- Fixed `POST /collections/test-collection/items` returning an item with an empty links array [#236](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/236)
Expand Down
6 changes: 3 additions & 3 deletions stac_fastapi/core/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"attrs",
"pydantic[dotenv]<2",
"stac_pydantic==2.0.*",
"stac-fastapi.types==2.5.3",
"stac-fastapi.api==2.5.3",
"stac-fastapi.extensions==2.5.3",
"stac-fastapi.types==2.5.5.post1",
"stac-fastapi.api==2.5.5.post1",
"stac-fastapi.extensions==2.5.5.post1",
"pystac[validation]",
"orjson",
"overrides",
Expand Down
18 changes: 18 additions & 0 deletions stac_fastapi/tests/resources/test_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,24 @@ async def test_returns_valid_collection(ctx, app_client):

@pytest.mark.asyncio
async def test_collection_extensions(ctx, app_client):
"""Test that extensions can be used to define additional top-level properties"""
ctx.collection.get("stac_extensions", []).append(
"https://stac-extensions.github.io/item-assets/v1.0.0/schema.json"
)
test_asset = {"title": "test", "description": "test", "type": "test"}
ctx.collection["item_assets"] = {"test": test_asset}
ctx.collection["id"] = "test-item-assets"
resp = await app_client.post("/collections", json=ctx.collection)

assert resp.status_code == 200
assert resp.json().get("item_assets", {}).get("test") == test_asset


@pytest.mark.skip(
reason="Broken as of stac-fastapi v2.5.5, the PUT collections route is not allowing the item_assets field to persist."
)
@pytest.mark.asyncio
async def test_collection_extensions_with_put(ctx, app_client):
"""Test that extensions can be used to define additional top-level properties"""
ctx.collection.get("stac_extensions", []).append(
"https://stac-extensions.github.io/item-assets/v1.0.0/schema.json"
Expand Down
5 changes: 2 additions & 3 deletions stac_fastapi/tests/resources/test_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,5 @@ async def test_search_datetime_validation_errors(app_client):
resp = await app_client.post("/search", json=body)
assert resp.status_code == 400

# Getting this instead ValueError: Invalid RFC3339 datetime.
# resp = await app_client.get("/search?datetime={}".format(dt))
# assert resp.status_code == 400
resp = await app_client.get("/search?datetime={}".format(dt))
assert resp.status_code == 400

0 comments on commit f1839d3

Please sign in to comment.