Skip to content

Commit

Permalink
Tweak vector rasterization test
Browse files Browse the repository at this point in the history
  • Loading branch information
dmannarino committed Oct 11, 2023
1 parent 375e6cd commit 3e3a093
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion batch/pixetl.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM globalforestwatch/pixetl:robustify_vector_tiles_1
FROM globalforestwatch/pixetl:robustify_vector_tiles

# Copy scripts
COPY ./batch/scripts/ /opt/scripts/
Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ def client():
except Exception as ex:
print(f"Exception deleting asset {asset['asset_id']}: {ex}")
try:
# FIXME: Mock-out cache invalidation function
_ = client.delete(f"/dataset/{ds_id}/{version}")
except Exception as ex:
print(f"Exception deleting version {version}: {ex}")
Expand Down
21 changes: 10 additions & 11 deletions tests/routes/datasets/test_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import httpx
import pytest
from botocore.exceptions import ClientError
from httpx import AsyncClient

from app.application import ContextEngine
from app.crud import tasks
Expand Down Expand Up @@ -255,21 +256,22 @@ async def test_auxiliary_raster_asset(async_client, httpd, logs):


@pytest.mark.asyncio
async def test_auxiliary_vector_asset(async_client, batch_client, httpd):
async def test_rasterize_vector_asset(async_client: AsyncClient, batch_client, httpd):
""""""
_, logs = batch_client

# Add a dataset, version, and default asset
dataset = "test_vector"
version = "v1.1.1"
grid = "10/40000"

pixetl_output_files = [
f"{dataset}/{version}/raster/epsg-4326/90/27008/gfw_fid/gdal-geotiff/extent.geojson",
f"{dataset}/{version}/raster/epsg-4326/90/27008/gfw_fid/geotiff/extent.geojson",
f"{dataset}/{version}/raster/epsg-4326/90/27008/gfw_fid/gdal-geotiff/tiles.geojson",
f"{dataset}/{version}/raster/epsg-4326/90/27008/gfw_fid/geotiff/tiles.geojson",
f"{dataset}/{version}/raster/epsg-4326/90/27008/gfw_fid/gdal-geotiff/90N_000E.tif",
f"{dataset}/{version}/raster/epsg-4326/90/27008/gfw_fid/geotiff/90N_000E.tif",
f"{dataset}/{version}/raster/epsg-4326/{grid}/gfw_fid/gdal-geotiff/extent.geojson",
f"{dataset}/{version}/raster/epsg-4326/{grid}/gfw_fid/geotiff/extent.geojson",
f"{dataset}/{version}/raster/epsg-4326/{grid}/gfw_fid/gdal-geotiff/tiles.geojson",
f"{dataset}/{version}/raster/epsg-4326/{grid}/gfw_fid/geotiff/tiles.geojson",
f"{dataset}/{version}/raster/epsg-4326/{grid}/gfw_fid/gdal-geotiff/60N_010E.tif",
f"{dataset}/{version}/raster/epsg-4326/{grid}/gfw_fid/geotiff/60N_010E.tif",
]

for key in pixetl_output_files:
Expand All @@ -294,15 +296,12 @@ async def test_auxiliary_vector_asset(async_client, batch_client, httpd):
# vector asset
asset_payload = {
"asset_type": "Raster tile set",
"asset_uri": "http://www.osnews.com",
"is_managed": True,
"creation_options": {
"data_type": FAKE_INT_DATA_PARAMS["dtype"],
"pixel_meaning": "gfw_fid",
"grid": "90/27008",
"grid": grid,
"resampling": "nearest",
"overwrite": True,
"subset": "90N_000E",
},
}

Expand Down

0 comments on commit 3e3a093

Please sign in to comment.