Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Polygon Query on Raster
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FACT
FACT Utils
Polygon Query on Raster
Commits
601ac400
Commit
601ac400
authored
5 months ago
by
Riccardo Boero
Browse files
Options
Downloads
Patches
Plain Diff
Changed the transform in test of process
parent
4fbfe056
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#2017
failed
5 months ago
Stage: test
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_process_geotiff.py
+5
-6
5 additions, 6 deletions
tests/test_process_geotiff.py
with
5 additions
and
6 deletions
tests/test_process_geotiff.py
+
5
−
6
View file @
601ac400
...
@@ -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
'
]
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment