Aggregate regional bathymetry partitions
This commit is contained in:
@@ -106,6 +106,56 @@ def test_current_vector_map_result_uses_authoritative_selection_export(monkeypat
|
||||
assert captured["limit"] == 1000
|
||||
|
||||
|
||||
def test_partitioned_vector_map_result_uses_governed_partition_export(monkeypatch) -> None:
|
||||
project_id = uuid4()
|
||||
dataset_id = uuid4()
|
||||
dataset = Dataset(
|
||||
id=dataset_id,
|
||||
project_id=project_id,
|
||||
name="vha-municipality.geojson",
|
||||
dataset_type="vector",
|
||||
source="VHA",
|
||||
source_name="vmm_vha_bathymetry_profiles",
|
||||
status="ready",
|
||||
)
|
||||
db = FakeSession({(Dataset, dataset_id): dataset})
|
||||
expected = ExportCreateResponse(
|
||||
export_id=uuid4(),
|
||||
path="storage/exports/bathymetry-profile-selection.geojson",
|
||||
status="ready",
|
||||
export_type="partitioned_vector_selection_geojson",
|
||||
)
|
||||
captured: dict = {}
|
||||
|
||||
def fake_partition_export(*args, **kwargs):
|
||||
captured["dataset"] = args[1]
|
||||
captured.update(kwargs)
|
||||
return expected
|
||||
|
||||
monkeypatch.setattr(
|
||||
ExportService,
|
||||
"export_partitioned_vector_selection_geojson",
|
||||
fake_partition_export,
|
||||
)
|
||||
response = ExportService.export_map_result(
|
||||
db,
|
||||
MapResultExportRequest(
|
||||
project_id=project_id,
|
||||
mode="current",
|
||||
dataset_id=dataset_id,
|
||||
bbox=bbox_payload(),
|
||||
partitioned=True,
|
||||
partition_scope_key="flanders",
|
||||
theme_id="bathymetry",
|
||||
),
|
||||
)
|
||||
|
||||
assert response is expected
|
||||
assert captured["dataset"] is dataset
|
||||
assert captured["partition_scope_key"] == "flanders"
|
||||
assert captured["limit"] == 1000
|
||||
|
||||
|
||||
def test_raster_map_result_is_recomputed_and_persisted(tmp_path, monkeypatch) -> None:
|
||||
project_id = uuid4()
|
||||
dataset_id = uuid4()
|
||||
|
||||
Reference in New Issue
Block a user