Skip to content

Commit

Permalink
update titiler test to point to new endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
solomon-negusse committed Oct 25, 2024
1 parent d255c24 commit 148ae02
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
3 changes: 2 additions & 1 deletion app/routes/titiler/integrated_alerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class GfwIntegratdAlertsVersions(str, Enum):
_versions = get_versions(dataset, TileCacheType.cog)
for _version in _versions:
extend_enum(GfwIntegratdAlertsVersions, _version, _version)
# TODO: add version validation


# will turn this on when we're ready to replace tile cache service
Expand All @@ -50,7 +51,7 @@ class GfwIntegratdAlertsVersions(str, Enum):
)
async def gfw_integrated_alerts_raster_tile(
*,
version: GfwIntegratdAlertsVersions,
version,
xyz: Tuple[int, int, int] = Depends(raster_xyz),
start_date: Optional[str] = Query(
None,
Expand Down
12 changes: 10 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,16 @@ def prep_titiler_tifs():
"s3",
endpoint_url=AWS_ENDPOINT_URI,
)
s3_client.upload_file(DATE_CONF_TIF, "gfw-data-lake-test", "default.tif")
s3_client.upload_file(DATE_CONF_TIF, "gfw-data-lake-test", "intensity.tif")
s3_client.upload_file(
DATE_CONF_TIF,
"gfw-data-lake-test",
"gfw_integrated_alerts/v20201012/raster/epsg-4326/cog/default.tif",
)
s3_client.upload_file(
DATE_CONF_TIF,
"gfw-data-lake-test",
"gfw_integrated_alerts/v20201012/raster/epsg-4326/cog/intensity.tif",
)
s3_client.upload_file(
COG_TIF,
"gfw-data-lake-test",
Expand Down
4 changes: 1 addition & 3 deletions tests/routes/test_cog_dynamic_tiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ async def test_tile_for_data_api_dataset(client):
@pytest.mark.asyncio
async def test_tiling_with_custom_rendering(client):
"""Test Integrated Alerts Tile Rendering."""
response = client.get(
"/cog/custom/tiles/WebMercatorQuad/14/5305/8879?url=s3://gfw-data-lake-test&bands=default&bands=intensity&algorithm=integrated_alerts&return_mask=False&format=png"
)
response = client.get("/gfw_integrated_alerts/v20201012/titiler/14/5305/8879.png")
response.status_code == 200

assert response.headers["content-type"] == "image/png"
Expand Down

0 comments on commit 148ae02

Please sign in to comment.