Skip to content

Commit 0a75fa9

Browse files
committed
test fixes
1 parent e7befd0 commit 0a75fa9

File tree

3 files changed

+35
-5
lines changed

3 files changed

+35
-5
lines changed

tests/test_dry_run.py

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,34 @@
2121
from openeo_driver.workspacerepository import WorkspaceRepository
2222
from tests.data import get_path, load_json, TEST_DATA_ROOT
2323

24+
CRS_UTM = {'$schema': 'https://proj.org/schemas/v0.2/projjson.schema.json',
25+
'area': 'World',
26+
'bbox': {'east_longitude': 180,
27+
'north_latitude': 90,
28+
'south_latitude': -90,
29+
'west_longitude': -180},
30+
'coordinate_system': {'axis': [{'abbreviation': 'Lat',
31+
'direction': 'north',
32+
'name': 'Geodetic '
33+
'latitude',
34+
'unit': 'degree'},
35+
{'abbreviation': 'Lon',
36+
'direction': 'east',
37+
'name': 'Geodetic '
38+
'longitude',
39+
'unit': 'degree'}],
40+
'subtype': 'ellipsoidal'},
41+
'datum': {'ellipsoid': {'inverse_flattening': 298.257223563,
42+
'name': 'WGS 84',
43+
'semi_major_axis': 6378137},
44+
'name': 'World Geodetic System 1984',
45+
'type': 'GeodeticReferenceFrame'},
46+
'id': {'authority': 'OGC',
47+
'code': 'Auto42001',
48+
'version': '1.3'},
49+
'name': 'AUTO 42001 (Universal Transverse '
50+
'Mercator)',
51+
'type': 'GeodeticCRS'}
2452

2553
@pytest.fixture
2654
def dry_run_tracer() -> DryRunDataTracer:
@@ -256,7 +284,7 @@ def test_evaluate_graph_diamond(dry_run_env, dry_run_tracer):
256284
"bands": ["grass"],
257285
"resample": {"method": "near",
258286
"resolution": [10, 10],
259-
"target_crs": "AUTO:42001"},
287+
"target_crs": CRS_UTM},
260288
"spatial_extent": {"west": 1, "east": 2, "south": 51, "north": 52, "crs": "EPSG:4326"}
261289
}), (
262290
("load_collection", ("S2_FOOBAR", ())),
@@ -1549,7 +1577,7 @@ def test_filter_after_merge_cubes(dry_run_env, dry_run_tracer):
15491577
'process_type': [ ProcessType.FOCAL_SPACE ],
15501578
'resample': {'method': 'average',
15511579
'resolution': [10, 10],
1552-
'target_crs': 'AUTO:42001'},
1580+
'target_crs': CRS_UTM},
15531581
'spatial_extent': {'crs': 'EPSG:32631',
15541582
'east': 642140.0,
15551583
'north': 5677450.0,

tests/test_views.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363

6464
from .conftest import TEST_APP_CONFIG, enhanced_logging
6565
from .data import TEST_DATA_ROOT, get_path
66+
from .test_dry_run import CRS_UTM
6667

6768
EXPECTED_PROCESSING_EXPRESSION = {"expression": {"process_graph": {"foo": {"process_id": "foo", "arguments": {}}}}, "format": "openeo"}
6869

@@ -1064,11 +1065,11 @@ def test_collection_full_metadata(self, api, api_version):
10641065
assert collection['license'] == 'free'
10651066
cube_dimensions = {
10661067
'x': {'extent': [2.5, 6.2],
1067-
'reference_system': 'AUTO:42001',
1068+
'reference_system': CRS_UTM,
10681069
'step': 10,
10691070
'type': 'spatial'},
10701071
'y': {'extent': [49.5, 51.5],
1071-
'reference_system': 'AUTO:42001',
1072+
'reference_system': CRS_UTM,
10721073
'step': 10,
10731074
'type': 'spatial'},
10741075
"t": {"type": "temporal", "extent": ["2019-01-01", None]},

tests/test_views_execute.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
from openeo_driver.utils import EvalEnv
5757

5858
from .data import TEST_DATA_ROOT, get_path, load_json
59+
from .test_dry_run import CRS_UTM
5960

6061

6162
@pytest.fixture(
@@ -516,7 +517,7 @@ def test_execute_resample_and_merge_cubes(api):
516517
api.check_result("resample_and_merge_cubes.json")
517518
dummy = dummy_backend.get_collection("S2_FAPAR_CLOUDCOVER")
518519
last_load_collection_call = dummy_backend.last_load_collection_call("S2_FAPAR_CLOUDCOVER")
519-
assert last_load_collection_call.target_crs == "AUTO:42001"
520+
assert last_load_collection_call.target_crs == CRS_UTM
520521
assert last_load_collection_call.target_resolution == [10, 10]
521522
assert dummy.merge_cubes.call_count == 1
522523
assert dummy.resample_cube_spatial.call_count == 1

0 commit comments

Comments
 (0)