Skip to content
Snippets Groups Projects
Commit 601ac400 authored by Riccardo Boero's avatar Riccardo Boero :innocent:
Browse files

Changed the transform in test of process

parent 4fbfe056
No related branches found
No related tags found
No related merge requests found
Pipeline #2017 failed
...@@ -21,16 +21,16 @@ def test_process_geotiff(): ...@@ -21,16 +21,16 @@ def test_process_geotiff():
# Mock glob to return a dummy file path # Mock glob to return a dummy file path
mock_glob.return_value = ['dummy.tif'] mock_glob.return_value = ['dummy.tif']
# Mock the rasterio open function # Mock the rasterio open function
mock_src = mock_raster.return_value.__enter__.return_value mock_src = mock_raster.return_value.__enter__.return_value
mock_src.read.return_value = np.random.rand(1, 10, 10) mock_src.read.return_value = np.random.rand(1, 10, 10)
# Correctly mock a valid affine transform (parameters: a, b, c, d, e, f) # Correctly mock a valid affine transform with required 6 arguments
mock_src.transform = Affine(1, 0, 0, # a, b, c mock_src.transform = Affine(30, 0, 0, # 30 units per pixel width, no rotation, no x-translation
0, -1, 0) # d, e, f 0, -30, 0) # 30 units per pixel height (negative to flip the y-axis), no y-translation
mock_src.crs = 'EPSG:4326' # CRS should match the polygon's CRS mock_src.crs = 'EPSG:4326' # CRS should match the polygon's CRS
# Instantiate the service # Instantiate the service
service = GeoTIFFService(directory='/dummy/path') service = GeoTIFFService(directory='/dummy/path')
...@@ -43,4 +43,3 @@ def test_process_geotiff(): ...@@ -43,4 +43,3 @@ def test_process_geotiff():
assert isinstance(stats['band_0']['count'], int) assert isinstance(stats['band_0']['count'], int)
assert 'min' in stats['band_0'] assert 'min' in stats['band_0']
assert 'max' in stats['band_0'] assert 'max' in stats['band_0']
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment