@@ -1268,11 +1268,13 @@ def test_read_vector(api):
12681268 )
12691269 resp = api .check_result (process_graph )
12701270 assert b'NaN' not in resp .data
1271- assert resp .json == {"2015-07-06T00:00:00Z" : [[2.345 ], [2.345 ]], "2015-08-22T00:00:00Z" : [[None ], [None ]]}
1271+ assert resp .json == {"2015-07-06T00:00:00Z" : [[2.345 ], [2.0 ]], "2015-08-22T00:00:00Z" : [[None ], [3.0 ]]}
12721272 params = dummy_backend .last_load_collection_call ('PROBAV_L3_S10_TOC_NDVI_333M_V2' )
12731273 assert params ["spatial_extent" ] == {"west" : 5 , "south" : 51 , "east" : 6 , "north" : 52 , "crs" : 'EPSG:4326' }
12741274 assert params ["temporal_extent" ] == ('2017-11-21' , '2017-12-21' )
1275- assert params ["aggregate_spatial_geometries" ] == DelayedVector (geometry_filename )
1275+ assert isinstance (params ["aggregate_spatial_geometries" ], DriverVectorCube )
1276+ assert len (params ["aggregate_spatial_geometries" ].get_cube ()) == 2
1277+ assert len (params ["aggregate_spatial_geometries" ].get_geometries ()) == 2
12761278
12771279
12781280def test_read_vector_no_load_collection_spatial_extent (api ):
@@ -1284,11 +1286,12 @@ def test_read_vector_no_load_collection_spatial_extent(api):
12841286 )
12851287 resp = api .check_result (process_graph )
12861288 assert b'NaN' not in resp .data
1287- assert resp .json == {"2015-07-06T00:00:00Z" : [[2.345 ], [2.345 ]], "2015-08-22T00:00:00Z" : [[None ], [None ]]}
1289+ assert resp .json == {"2015-07-06T00:00:00Z" : [[2.345 ], [2.0 ]], "2015-08-22T00:00:00Z" : [[None ], [3.0 ]]}
12881290 params = dummy_backend .last_load_collection_call ('PROBAV_L3_S10_TOC_NDVI_333M_V2' )
12891291 assert params ["spatial_extent" ] == {"west" : 5.05 , "south" : 51.21 , "east" : 5.15 , "north" : 51.3 , "crs" : 'EPSG:4326' }
12901292 assert params ["temporal_extent" ] == ('2017-11-21' , '2017-12-21' )
1291- assert params ["aggregate_spatial_geometries" ] == DelayedVector (geometry_filename )
1293+ assert len (params ["aggregate_spatial_geometries" ].get_cube ()) == 2
1294+ assert len (params ["aggregate_spatial_geometries" ].get_geometries ()) == 2
12921295
12931296
12941297@pytest .mark .parametrize ("udf_code" , [
@@ -1595,13 +1598,10 @@ def test_load_collection_without_spatial_extent_incorporates_read_vector_extent(
15951598 preprocess = lambda s : s .replace ("PLACEHOLDER" , str (get_path ("geojson/GeometryCollection01.json" )))
15961599 )
15971600 resp = api .check_result (process_graph )
1598- assert b'NaN' not in resp .data
1599- assert resp .json == {
1600- "2015-07-06T00:00:00Z" : [[2.345 ], [2.345 ]],
1601- "2015-08-22T00:00:00Z" : [[None ], [None ]]
1602- }
1603- params = dummy_backend .last_load_collection_call ('PROBAV_L3_S10_TOC_NDVI_333M_V2' )
1604- assert params ["spatial_extent" ] == {"west" : 5.05 , "south" : 51.21 , "east" : 5.15 , "north" : 51.3 , "crs" : 'EPSG:4326' }
1601+ assert b"NaN" not in resp .data
1602+ assert resp .json == {"2015-07-06T00:00:00Z" : [[2.345 ], [2.0 ]], "2015-08-22T00:00:00Z" : [[None ], [3.0 ]]}
1603+ params = dummy_backend .last_load_collection_call ("PROBAV_L3_S10_TOC_NDVI_333M_V2" )
1604+ assert params ["spatial_extent" ] == {"west" : 5.05 , "south" : 51.21 , "east" : 5.15 , "north" : 51.3 , "crs" : "EPSG:4326" }
16051605
16061606
16071607def test_read_vector_from_feature_collection (api ):
@@ -1610,13 +1610,10 @@ def test_read_vector_from_feature_collection(api):
16101610 preprocess = lambda s : s .replace ("PLACEHOLDER" , str (get_path ("geojson/FeatureCollection01.json" )))
16111611 )
16121612 resp = api .check_result (process_graph )
1613- assert b'NaN' not in resp .data
1614- assert resp .json == {
1615- "2015-07-06T00:00:00Z" : [[2.345 ], [2.345 ]],
1616- "2015-08-22T00:00:00Z" : [[None ], [None ]]
1617- }
1618- params = dummy_backend .last_load_collection_call ('PROBAV_L3_S10_TOC_NDVI_333M_V2' )
1619- assert params ["spatial_extent" ] == {"west" : 5 , "south" : 51 , "east" : 6 , "north" : 52 , "crs" : 'EPSG:4326' }
1613+ assert b"NaN" not in resp .data
1614+ assert resp .json == {"2015-07-06T00:00:00Z" : [[2.345 ], [2.0 ]], "2015-08-22T00:00:00Z" : [[None ], [3.0 ]]}
1615+ params = dummy_backend .last_load_collection_call ("PROBAV_L3_S10_TOC_NDVI_333M_V2" )
1616+ assert params ["spatial_extent" ] == {"west" : 5 , "south" : 51 , "east" : 6 , "north" : 52 , "crs" : "EPSG:4326" }
16201617
16211618
16221619class TestVectorCubeLoading :
0 commit comments