@@ -50,11 +50,6 @@ def api(api_version, client) -> ApiTester:
50
50
return ApiTester (api_version = api_version , client = client , data_root = TEST_DATA_ROOT )
51
51
52
52
53
- @pytest .fixture
54
- def api040 (client ) -> ApiTester :
55
- return ApiTester (api_version = "0.4.0" , client = client , data_root = TEST_DATA_ROOT )
56
-
57
-
58
53
@pytest .fixture
59
54
def api100 (client ) -> ApiTester :
60
55
return ApiTester (api_version = "1.0.0" , client = client , data_root = TEST_DATA_ROOT )
@@ -127,7 +122,6 @@ def test_well_known_openeo(self, client):
127
122
by_api_version = {d ["api_version" ]: d for d in versions }
128
123
assert len (versions ) == len (by_api_version )
129
124
assert by_api_version == {
130
- "0.4.2" : {'api_version' : '0.4.2' , 'production' : True , 'url' : 'http://oeo.net/openeo/0.4/' },
131
125
"1.0.0" : {'api_version' : '1.0.0' , 'production' : True , 'url' : 'http://oeo.net/openeo/1.0/' },
132
126
"1.1.0" : {'api_version' : '1.1.0' , 'production' : True , 'url' : 'http://oeo.net/openeo/1.1/' },
133
127
}
@@ -146,7 +140,6 @@ def test_https_proxy_handling(self, client, headers, expected):
146
140
assert url .startswith (expected )
147
141
148
142
@pytest .mark .parametrize (["url" , "expected_version" ], [
149
- ("/openeo/0.4/" , "0.4.2" ),
150
143
("/openeo/1.0/" , "1.0.0" ),
151
144
("/openeo/1.0.0/" , "1.0.0" ),
152
145
("/openeo/1.1/" , "1.1.0" ),
@@ -160,14 +153,6 @@ def test_versioned_urls(self, client, url, expected_version):
160
153
assert capabilities ["title" ] == "openEO Unit Test Dummy Backend"
161
154
assert capabilities ["api_version" ] == expected_version
162
155
163
- def test_capabilities_040 (self , api040 ):
164
- capabilities = api040 .get ('/' ).assert_status_code (200 ).json
165
- assert capabilities ["api_version" ] == "0.4.0"
166
- assert capabilities ["version" ] == "0.4.0"
167
- assert capabilities ["stac_version" ] == "0.9.0"
168
- assert capabilities ["title" ] == "openEO Unit Test Dummy Backend"
169
- assert capabilities ["id" ] == "openeounittestdummybackend-0.4.0"
170
- assert capabilities ["production" ] is True
171
156
172
157
def test_capabilities_100 (self , api100 ):
173
158
capabilities = api100 .get ('/' ).assert_status_code (200 ).json
@@ -234,12 +219,6 @@ def validate(self, *args, **kwargs):
234
219
endpoints = {e ["path" ]: sorted (e ["methods" ]) for e in capabilities ["endpoints" ]}
235
220
assert "/validation" not in endpoints
236
221
237
- def test_capabilities_endpoints_issue_28_v040 (self , api040 ):
238
- """https://github.com/Open-EO/openeo-python-driver/issues/28"""
239
- capabilities = api040 .get ("/" ).assert_status_code (200 ).json
240
- endpoints = {e ["path" ]: e ["methods" ] for e in capabilities ["endpoints" ]}
241
- assert endpoints ["/output_formats" ] == ["GET" ]
242
- assert "/file_formats" not in endpoints
243
222
244
223
def test_capabilities_endpoints_issue_28_v100 (self , api100 ):
245
224
"""https://github.com/Open-EO/openeo-python-driver/issues/28"""
@@ -452,9 +431,6 @@ def health(options: Optional[dict] = None):
452
431
resp = api .get ('/health?shape=square&color=red' ).assert_status_code (200 ).json
453
432
assert resp == {"status" : "OK" , "color" : "red" }
454
433
455
- def test_credentials_oidc_040 (self , api040 ):
456
- resp = api040 .get ('/credentials/oidc' ).assert_status_code (303 )
457
- assert resp .headers ["Location" ] == "https://oidc.test/.well-known/openid-configuration"
458
434
459
435
def test_credentials_oidc_100 (self , api100 ):
460
436
resp = api100 .get ('/credentials/oidc' ).assert_status_code (200 ).json
@@ -469,9 +445,6 @@ def test_credentials_oidc_100(self, api100):
469
445
DictSubSet ({'id' : 'local' })
470
446
])}
471
447
472
- def test_output_formats (self , api040 ):
473
- resp = api040 .get ('/output_formats' ).assert_status_code (200 ).json
474
- assert resp == {"GTiff" : {"title" : "GeoTiff" , "gis_data_types" : ["raster" ], "parameters" : {}}, }
475
448
476
449
def test_file_formats (self , api100 ):
477
450
response = api100 .get ('/file_formats' )
@@ -519,17 +492,6 @@ def test_processes_non_standard_atmospheric_correction(self, api):
519
492
assert spec ["links" ][0 ]["rel" ] == "about"
520
493
assert "DigitalElevationModelInvalid" in spec ["exceptions" ]
521
494
522
- def test_processes_040_vs_100 (self , api040 , api100 ):
523
- pids040 = {p ['id' ] for p in api040 .get ("/processes" ).assert_status_code (200 ).json ["processes" ]}
524
- pids100 = {p ['id' ] for p in api100 .get ("/processes" ).assert_status_code (200 ).json ["processes" ]}
525
- expected_only_040 = {'aggregate_polygon' }
526
- expected_only_100 = {'reduce_dimension' , 'aggregate_spatial' , 'mask_polygon' , 'add' }
527
- for pid in expected_only_040 :
528
- assert pid in pids040
529
- assert pid not in pids100
530
- for pid in expected_only_100 :
531
- assert pid not in pids040
532
- assert pid in pids100
533
495
534
496
def test_custom_process_listing (self , api100 ):
535
497
process_id = generate_unique_test_process_id ()
@@ -970,33 +932,6 @@ def _fresh_job_registry(next_job_id="job-1234", output_root: Optional[Path] = No
970
932
)
971
933
yield dummy_backend .DummyBatchJobs ._job_registry
972
934
973
- def test_create_job_040 (self , api040 ):
974
- with self ._fresh_job_registry (next_job_id = "job-220" ):
975
- resp = api040 .post ('/jobs' , headers = self .AUTH_HEADER , json = {
976
- 'title' : 'foo job' ,
977
- 'process_graph' : {"foo" : {"process_id" : "foo" , "arguments" : {}}},
978
- }).assert_status_code (201 )
979
- assert resp .headers ['Location' ] == 'http://oeo.net/openeo/0.4.0/jobs/job-220'
980
- assert resp .headers ['OpenEO-Identifier' ] == 'job-220'
981
- job_info = dummy_backend .DummyBatchJobs ._job_registry [TEST_USER , 'job-220' ]
982
- assert job_info .id == "job-220"
983
- assert job_info .process == {"process_graph" : {"foo" : {"process_id" : "foo" , "arguments" : {}}}}
984
- assert job_info .status == "created"
985
- assert job_info .created == dummy_backend .DEFAULT_DATETIME
986
- assert job_info .job_options is None
987
-
988
- def test_create_job_with_options_040 (self , api040 ):
989
- with self ._fresh_job_registry (next_job_id = "job-230" ):
990
- resp = api040 .post ('/jobs' , headers = self .AUTH_HEADER , json = {
991
- 'title' : 'foo job' ,
992
- 'process_graph' : {"foo" : {"process_id" : "foo" , "arguments" : {}}},
993
- 'job_options' : {"driver-memory" : "3g" , "executor-memory" : "5g" },
994
- }).assert_status_code (201 )
995
- assert resp .headers ['Location' ] == 'http://oeo.net/openeo/0.4.0/jobs/job-230'
996
- assert resp .headers ['OpenEO-Identifier' ] == 'job-230'
997
- job_info = dummy_backend .DummyBatchJobs ._job_registry [TEST_USER , 'job-230' ]
998
- assert job_info .job_options == {"driver-memory" : "3g" , "executor-memory" : "5g" }
999
-
1000
935
def test_create_job_100 (self , api100 ):
1001
936
with self ._fresh_job_registry (next_job_id = "job-245" ):
1002
937
resp = api100 .post ('/jobs' , headers = self .AUTH_HEADER , json = {
@@ -1080,16 +1015,6 @@ def test_start_job_invalid(self, api):
1080
1015
resp .assert_error (404 , "JobNotFound" )
1081
1016
assert resp .json ["message" ] == "The batch job 'deadbeef-f00' does not exist."
1082
1017
1083
- def test_get_job_info_040 (self , api040 ):
1084
- with self ._fresh_job_registry ():
1085
- resp = api040 .get ('/jobs/07024ee9-7847-4b8a-b260-6c879a2b3cdc' , headers = self .AUTH_HEADER )
1086
- assert resp .assert_status_code (200 ).json == {
1087
- 'id' : '07024ee9-7847-4b8a-b260-6c879a2b3cdc' ,
1088
- 'status' : 'running' ,
1089
- 'submitted' : "2017-01-01T09:32:12Z" ,
1090
- 'process_graph' : {'foo' : {'process_id' : 'foo' , 'arguments' : {}}},
1091
- }
1092
-
1093
1018
def test_get_job_info_metrics_100 (self , api100 ):
1094
1019
resp = api100 .get ('/jobs/53c71345-09b4-46b4-b6b0-03fd6fe1f199' , headers = self .AUTH_HEADER )
1095
1020
assert resp .assert_status_code (200 ).json == {
@@ -1125,32 +1050,6 @@ def test_get_job_info_invalid(self, api):
1125
1050
resp = api .get ('/jobs/deadbeef-f00' , headers = self .AUTH_HEADER ).assert_error (404 , "JobNotFound" )
1126
1051
assert resp .json ["message" ] == "The batch job 'deadbeef-f00' does not exist."
1127
1052
1128
- def test_list_user_jobs_040 (self , api040 ):
1129
- with self ._fresh_job_registry ():
1130
- resp = api040 .get ('/jobs' , headers = self .AUTH_HEADER )
1131
- assert resp .assert_status_code (200 ).json == {
1132
- "jobs" : [
1133
- {
1134
- 'id' : '07024ee9-7847-4b8a-b260-6c879a2b3cdc' ,
1135
- 'status' : 'running' ,
1136
- 'submitted' : "2017-01-01T09:32:12Z" ,
1137
- },
1138
- {
1139
- 'id' : '53c71345-09b4-46b4-b6b0-03fd6fe1f199' ,
1140
- 'title' : "Your title here." ,
1141
- 'description' : "Your description here." ,
1142
- 'status' : 'finished' ,
1143
- 'progress' : 100 ,
1144
- 'submitted' : "2020-06-11T11:51:29Z" ,
1145
- 'updated' : "2020-06-11T11:55:15Z" ,
1146
- 'plan' : 'some_plan' ,
1147
- 'costs' : 1.23 ,
1148
- 'budget' : 4.56
1149
- }
1150
- ],
1151
- "links" : []
1152
- }
1153
-
1154
1053
def test_list_user_jobs_100 (self , api100 ):
1155
1054
with self ._fresh_job_registry ():
1156
1055
resp = api100 .get ('/jobs' , headers = self .AUTH_HEADER )
@@ -1204,25 +1103,6 @@ def test_get_job_results_unfinished(self, api):
1204
1103
resp = api .get ('/jobs/07024ee9-7847-4b8a-b260-6c879a2b3cdc/results' , headers = self .AUTH_HEADER )
1205
1104
resp .assert_error (400 , "JobNotFinished" )
1206
1105
1207
- def test_get_job_results_040 (self , api040 ):
1208
- with self ._fresh_job_registry (next_job_id = "job-349" ):
1209
- dummy_backend .DummyBatchJobs ._update_status (
1210
- job_id = "07024ee9-7847-4b8a-b260-6c879a2b3cdc" , user_id = TEST_USER , status = "finished" )
1211
- resp = api040 .get ('/jobs/07024ee9-7847-4b8a-b260-6c879a2b3cdc/results' , headers = self .AUTH_HEADER )
1212
- assert resp .assert_status_code (200 ).json == {
1213
- "links" : [
1214
- {
1215
- "href" : "http://oeo.net/openeo/0.4.0/jobs/07024ee9-7847-4b8a-b260-6c879a2b3cdc/results/assets/output.tiff"
1216
- },
1217
- {
1218
- 'href' : 'http://oeo.net/openeo/0.4.0/jobs/07024ee9-7847-4b8a-b260-6c879a2b3cdc/results/assets/randomforest.model'
1219
- },
1220
- {
1221
- "href" : "http://oeo.net/openeo/0.4.0/jobs/07024ee9-7847-4b8a-b260-6c879a2b3cdc/results/assets/ml_model_metadata.json"
1222
- }
1223
- ]
1224
- }
1225
-
1226
1106
def test_get_job_results_100 (self , api100 ):
1227
1107
with self ._fresh_job_registry (next_job_id = "job-362" ):
1228
1108
dummy_backend .DummyBatchJobs ._update_status (
@@ -1375,26 +1255,6 @@ def test_get_job_results_public_href_asset_100(self, api100, backend_implementat
1375
1255
}
1376
1256
}
1377
1257
1378
- def test_get_job_results_signed_040 (self , api040 , flask_app ):
1379
- app_config = {'SIGNED_URL' : 'TRUE' , 'SIGNED_URL_SECRET' : '123&@#' }
1380
- with mock .patch .dict (flask_app .config , app_config ), self ._fresh_job_registry ():
1381
- dummy_backend .DummyBatchJobs ._update_status (
1382
- job_id = '07024ee9-7847-4b8a-b260-6c879a2b3cdc' , user_id = TEST_USER , status = 'finished' )
1383
- resp = api040 .get ('/jobs/07024ee9-7847-4b8a-b260-6c879a2b3cdc/results' , headers = self .AUTH_HEADER )
1384
- assert resp .assert_status_code (200 ).json == {
1385
- 'links' : [
1386
- {
1387
- 'href' : 'http://oeo.net/openeo/0.4.0/jobs/07024ee9-7847-4b8a-b260-6c879a2b3cdc/results/assets/TXIuVGVzdA%3D%3D/50afb0cad129e61d415278c4ffcd8a83/output.tiff'
1388
- },
1389
- {
1390
- 'href' : 'http://oeo.net/openeo/0.4.0/jobs/07024ee9-7847-4b8a-b260-6c879a2b3cdc/results/assets/TXIuVGVzdA%3D%3D/741cfd7379a9eda4bc1c8b0c5155bfe9/randomforest.model'
1391
- },
1392
- {
1393
- 'href' : 'http://oeo.net/openeo/0.4.0/jobs/07024ee9-7847-4b8a-b260-6c879a2b3cdc/results/assets/TXIuVGVzdA%3D%3D/272d7aa46727ee3f11a7211d5be953e4/ml_model_metadata.json'
1394
- }
1395
- ]
1396
- }
1397
-
1398
1258
def test_get_job_results_signed_100 (self , api100 , flask_app ):
1399
1259
app_config = {'SIGNED_URL' : 'TRUE' , 'SIGNED_URL_SECRET' : '123&@#' }
1400
1260
with mock .patch .dict (flask_app .config , app_config ), self ._fresh_job_registry ():
@@ -1457,27 +1317,6 @@ def test_get_job_results_signed_100(self, api100, flask_app):
1457
1317
'type' : 'Feature'
1458
1318
}
1459
1319
1460
- @mock .patch ('time.time' , mock .MagicMock (return_value = 1234 ))
1461
- def test_get_job_results_signed_with_expiration_040 (self , api040 , flask_app ):
1462
- app_config = {'SIGNED_URL' : 'TRUE' , 'SIGNED_URL_SECRET' : '123&@#' , 'SIGNED_URL_EXPIRATION' : '1000' }
1463
- with mock .patch .dict (flask_app .config , app_config ), self ._fresh_job_registry ():
1464
- dummy_backend .DummyBatchJobs ._update_status (
1465
- job_id = '07024ee9-7847-4b8a-b260-6c879a2b3cdc' , user_id = TEST_USER , status = 'finished' )
1466
- resp = api040 .get ('/jobs/07024ee9-7847-4b8a-b260-6c879a2b3cdc/results' , headers = self .AUTH_HEADER )
1467
- assert resp .assert_status_code (200 ).json == {
1468
- 'links' : [
1469
- {
1470
- 'href' : 'http://oeo.net/openeo/0.4.0/jobs/07024ee9-7847-4b8a-b260-6c879a2b3cdc/results/assets/TXIuVGVzdA%3D%3D/fd0ca65e29c6d223da05b2e73a875683/output.tiff?expires=2234'
1471
- },
1472
- {
1473
- 'href' : 'http://oeo.net/openeo/0.4.0/jobs/07024ee9-7847-4b8a-b260-6c879a2b3cdc/results/assets/TXIuVGVzdA%3D%3D/22b76413158c59acaccc74e74841a473/randomforest.model?expires=2234'
1474
- },
1475
- {
1476
- 'href' : 'http://oeo.net/openeo/0.4.0/jobs/07024ee9-7847-4b8a-b260-6c879a2b3cdc/results/assets/TXIuVGVzdA%3D%3D/a23629392982e57e7312e34de4bdba95/ml_model_metadata.json?expires=2234'
1477
- }
1478
- ]
1479
- }
1480
-
1481
1320
@mock .patch ('time.time' , mock .MagicMock (return_value = 1234 ))
1482
1321
def test_get_job_results_signed_with_expiration_100 (self , api100 , flask_app ):
1483
1322
app_config = {'SIGNED_URL' : 'TRUE' , 'SIGNED_URL_SECRET' : '123&@#' , 'SIGNED_URL_EXPIRATION' : '1000' }
@@ -1895,21 +1734,6 @@ def test_unsupported_services_methods_return_405_MethodNotAllowed(self, api):
1895
1734
})
1896
1735
res .assert_status_code (405 )
1897
1736
1898
- def test_list_services_040 (self , api040 ):
1899
- metadata = api040 .get ('/services' , headers = self .AUTH_HEADER ).json
1900
- assert metadata == {
1901
- "services" : [{
1902
- 'id' : 'wmts-foo' ,
1903
- 'type' : 'WMTS' ,
1904
- 'enabled' : True ,
1905
- 'url' : 'https://oeo.net/wmts/foo' ,
1906
- 'submitted' : '2020-04-09T15:05:08Z' ,
1907
- 'title' : 'Test service' ,
1908
- 'parameters' : {'version' : '0.5.8' },
1909
- }],
1910
- "links" : []
1911
- }
1912
-
1913
1737
def test_list_services_100 (self , api100 ):
1914
1738
metadata = api100 .get ('/services' , headers = self .AUTH_HEADER ).json
1915
1739
assert metadata == {
@@ -1925,20 +1749,6 @@ def test_list_services_100(self, api100):
1925
1749
"links" : []
1926
1750
}
1927
1751
1928
- def test_get_service_metadata_040 (self , api040 ):
1929
- metadata = api040 .get ('/services/wmts-foo' , headers = self .AUTH_HEADER ).json
1930
- assert metadata == {
1931
- "id" : "wmts-foo" ,
1932
- "process_graph" : {"foo" : {"process_id" : "foo" , "arguments" : {}}},
1933
- "url" : "https://oeo.net/wmts/foo" ,
1934
- "type" : "WMTS" ,
1935
- "enabled" : True ,
1936
- "parameters" : {"version" : "0.5.8" },
1937
- "attributes" : {},
1938
- "title" : "Test service" ,
1939
- 'submitted' : '2020-04-09T15:05:08Z' ,
1940
- }
1941
-
1942
1752
def test_get_service_metadata_100 (self , api100 ):
1943
1753
metadata = api100 .get ('/services/wmts-foo' , headers = self .AUTH_HEADER ).json
1944
1754
assert metadata == {
0 commit comments