Add bounded Flanders thematic analysis
This commit is contained in:
@@ -17,7 +17,7 @@ from app.core.config import Settings
|
||||
from app.core.errors import AppError
|
||||
from app.db.session import get_db
|
||||
from app.main import app
|
||||
from app.models import Dataset, Job, Project
|
||||
from app.models import Area, Dataset, Job, Project
|
||||
from app.schemas.thematic_raster import ThematicRasterAcquireRequest, ThematicRasterSelectionRequest
|
||||
from app.schemas.assistant import AssistantQueryRequest
|
||||
from app.services.geo_assistant_service import GeoAssistantService
|
||||
@@ -177,6 +177,20 @@ def test_complete_kempen_scope_fits_the_tiled_thematic_guardrails() -> None:
|
||||
assert exc_info.value.code == "THEMATIC_RASTER_SELECTION_TOO_LARGE"
|
||||
|
||||
|
||||
def test_coverage_scope_only_labels_named_municipality_areas_as_municipality() -> None:
|
||||
project_id = uuid4()
|
||||
municipality_id = uuid4()
|
||||
region_id = uuid4()
|
||||
db = FakeSession({
|
||||
(Area, municipality_id): Area(id=municipality_id, project_id=project_id, name="Gemeente Mol"),
|
||||
(Area, region_id): Area(id=region_id, project_id=project_id, name="Vlaanderen"),
|
||||
})
|
||||
|
||||
assert ThematicRasterAcquisitionService._coverage_scope(db, municipality_id) == "municipality"
|
||||
assert ThematicRasterAcquisitionService._coverage_scope(db, region_id) == "bounded_selection"
|
||||
assert ThematicRasterAcquisitionService._coverage_scope(db, None) == "bounded_selection"
|
||||
|
||||
|
||||
def test_wcs_fetch_retries_an_incomplete_tile_without_accepting_partial_bytes(monkeypatch) -> None:
|
||||
content = b"II*\x00complete-geotiff"
|
||||
responses = [IncompleteResponse(content), FakeResponse(content)]
|
||||
|
||||
Reference in New Issue
Block a user