fix(platform): govern geospatial analysis and raster handoffs
This commit is contained in:
@@ -12,8 +12,12 @@ class FakeUploadFile:
|
||||
filename = "real-orthophoto.tif"
|
||||
content_type = "image/tiff"
|
||||
|
||||
async def read(self) -> bytes:
|
||||
return b"fake-raster"
|
||||
def __init__(self) -> None:
|
||||
self._content = b"fake-raster"
|
||||
|
||||
async def read(self, size: int) -> bytes:
|
||||
chunk, self._content = self._content[:size], self._content[size:]
|
||||
return chunk
|
||||
|
||||
|
||||
class FakeSession:
|
||||
@@ -40,16 +44,19 @@ def test_raster_upload_maps_metadata_bounds_resolution_and_bands(monkeypatch) ->
|
||||
project_id = uuid4()
|
||||
db = FakeSession(project_id)
|
||||
|
||||
monkeypatch.setattr(
|
||||
"app.services.dataset_service.StorageService.persist_dataset_file",
|
||||
lambda **_: {
|
||||
async def persist_upload_file(**_kwargs):
|
||||
return {
|
||||
"storage_path": "/tmp/real-orthophoto.tif",
|
||||
"original_filename": "real-orthophoto.tif",
|
||||
"stored_filename": "real-orthophoto.tif",
|
||||
"content_type": "image/tiff",
|
||||
"size_bytes": 11,
|
||||
"checksum_sha256": "checksum",
|
||||
},
|
||||
}
|
||||
|
||||
monkeypatch.setattr(
|
||||
"app.services.dataset_service.StorageService.persist_upload_file",
|
||||
persist_upload_file,
|
||||
)
|
||||
monkeypatch.setattr(
|
||||
"app.services.dataset_service.extract_raster_metadata",
|
||||
|
||||
Reference in New Issue
Block a user