43
43
from .data import TEST_DATA_ROOT , get_path , load_json
44
44
45
45
46
- @pytest .fixture (params = ["1.0.0" ])
46
+ @pytest .fixture (
47
+ params = [
48
+ "1.0" ,
49
+ # "1.1",
50
+ "1.2" ,
51
+ ]
52
+ )
47
53
def api_version (request ):
48
54
return request .param
49
55
@@ -52,7 +58,11 @@ def api_version(request):
52
58
def api (api_version , client , backend_implementation ) -> ApiTester :
53
59
dummy_backend .reset (backend_implementation )
54
60
55
- data_root = TEST_DATA_ROOT / "pg" / ("." .join (api_version .split ("." )[:2 ]))
61
+ if api_version .startswith ("1." ):
62
+ # For now, use "pg/1.0" for all 1.x API requests (no need to differentiate yet)
63
+ data_root = TEST_DATA_ROOT / "pg" / "1.0"
64
+ else :
65
+ raise ValueError (api_version )
56
66
return ApiTester (api_version = api_version , client = client , data_root = data_root )
57
67
58
68
@@ -2781,6 +2791,8 @@ def test_execute_no_cube_logic(api, process_graph, expected):
2781
2791
],
2782
2792
)
2783
2793
def test_text_processes (api , process_id , arguments , expected ):
2794
+ if process_id == "text_merge" and api .api_version_compare >= "1.2" :
2795
+ pytest .skip ("text_merge is dropped since API version 1.2" )
2784
2796
# TODO: null propagation (`text_begins(data=null,...) -> null`) can not be tested at the moment
2785
2797
pg = {"t" : {"process_id" : process_id , "arguments" : arguments , "result" :True }}
2786
2798
assert api .result (pg ).assert_status_code (200 ).json == expected
@@ -3531,16 +3543,27 @@ def test_vector_buffer_ogc_crs84(api, distance, unit, expected):
3531
3543
3532
3544
3533
3545
def test_load_result (api ):
3546
+ if api .api_version_compare >= "1.2" :
3547
+ pytest .skip ("load_result is dropped since API version 1.2" )
3534
3548
api .check_result ("load_result.json" )
3535
3549
params = dummy_backend .last_load_collection_call ("99a605a0-1a10-4ba9-abc1-6898544e25fc" )
3536
3550
3537
3551
assert params ["temporal_extent" ] == ('2019-09-22' , '2019-09-22' )
3538
3552
3539
3553
3540
3554
def test_chunk_polygon (api ):
3555
+ if api .api_version_compare >= "1.2" :
3556
+ pytest .skip ("chunk_polygon is dropped since API version 1.2" )
3557
+
3541
3558
api .check_result ("chunk_polygon.json" )
3542
3559
params = dummy_backend .last_load_collection_call ("S2_FOOBAR" )
3543
- assert params ["spatial_extent" ] == {'west' : 1.0 , 'south' : 5.0 , 'east' : 12.0 , 'north' : 16.0 , 'crs' : 'EPSG:4326' }
3560
+ assert params ["spatial_extent" ] == {"west" : 1.0 , "south" : 5.0 , "east" : 12.0 , "north" : 16.0 , "crs" : "EPSG:4326" }
3561
+
3562
+
3563
+ def test_apply_polygon (api ):
3564
+ api .check_result ("apply_polygon.json" )
3565
+ params = dummy_backend .last_load_collection_call ("S2_FOOBAR" )
3566
+ assert params ["spatial_extent" ] == {"west" : 1.0 , "south" : 5.0 , "east" : 12.0 , "north" : 16.0 , "crs" : "EPSG:4326" }
3544
3567
3545
3568
3546
3569
def test_fit_class_random_forest (api ):
0 commit comments