-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #187 from stac-utils/feature/add-external-and-asse…
…ts-endpoints Feature/add external and assets endpoints
- Loading branch information
Showing
12 changed files
with
119 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
version: '3' | ||
|
||
services: | ||
tiler: | ||
container_name: tiler-pgstac | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
"""test external cog and asset endpoints.""" | ||
|
||
from unittest.mock import patch | ||
|
||
from .conftest import mock_rasterio_open | ||
|
||
|
||
@patch("rio_tiler.io.rasterio.rasterio") | ||
def test_cog_assets(rio, app): | ||
"""test STAC Assets endpoints.""" | ||
rio.open = mock_rasterio_open | ||
|
||
response = app.get( | ||
"/collections/noaa-emergency-response/items/20200307aC0853900w361030/assets/cog/info", | ||
) | ||
assert response.status_code == 200 | ||
resp = response.json() | ||
assert resp["bounds"] | ||
|
||
response = app.get( | ||
"/collections/noaa-emergency-response/items/20200307aC0853900w361030/assets/cog/WebMercatorQuad/tilejson.json", | ||
) | ||
assert response.status_code == 200 | ||
resp = response.json() | ||
assert resp["tilejson"] | ||
|
||
|
||
def test_external_cog(app): | ||
"""test external cog endpoints.""" | ||
response = app.get( | ||
"/external/info", | ||
params={"url": "tests/fixtures/20200307aC0853900w361030n.tif"}, | ||
) | ||
assert response.status_code == 200 | ||
resp = response.json() | ||
assert resp["bounds"] | ||
|
||
response = app.get( | ||
"/external/WebMercatorQuad/tilejson.json", | ||
params={"url": "tests/fixtures/20200307aC0853900w361030n.tif"}, | ||
) | ||
assert response.status_code == 200 | ||
resp = response.json() | ||
assert resp["tilejson"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters