From c8990c5244ee2d2ef3ba1acef4e9a0793e8d3cf1 Mon Sep 17 00:00:00 2001 From: Jan Van den bosch Date: Tue, 20 Feb 2024 11:20:20 +0100 Subject: [PATCH] add (skipped) test https://github.com/Open-EO/openeo-python-driver/issues/261 --- tests/test_batch_result.py | 61 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/tests/test_batch_result.py b/tests/test_batch_result.py index f6b3933fe..09be87bac 100644 --- a/tests/test_batch_result.py +++ b/tests/test_batch_result.py @@ -1,4 +1,5 @@ import json +import os from pathlib import Path import geopandas as gpd @@ -530,3 +531,63 @@ def test_spatial_cube_to_netcdf_sample_by_feature(tmp_path): assert assets["openEO_1.nc"]["bbox"] == [0.725, -1.29, 2.99, 1.724] assert (shape(assets["openEO_1.nc"]["geometry"]).normalize() .almost_equals(Polygon.from_bounds(0.725, -1.29, 2.99, 1.724).normalize())) + + +def skip_multiple_time_series_results(tmp_path): # https://github.com/Open-EO/openeo-python-driver/issues/261 + job_spec = { + "process_graph": { + "loadcollection1": { + "process_id": "load_collection", + "arguments": { + "id": "TestCollection-LonLat4x4", + "spatial_extent": {"west": 0.0, "south": 50.0, "east": 5.0, "north": 55.0}, + "temporal_extent": ["2021-01-04", "2021-01-06"], + "bands": ["Flat:2"] + }, + }, + "aggregatespatial1": { + "process_id": "aggregate_spatial", + "arguments": { + "data": {"from_node": "loadcollection1"}, + "geometries": { + "type": "Point", + "coordinates": [2.5, 52.5], + }, + "reducer": { + "process_graph": { + "mean1": { + "process_id": "mean", + "arguments": { + "data": {"from_parameter": "data"} + }, + "result": True, + } + } + } + }, + }, + "saveresult1": { + "process_id": "save_result", + "arguments": { + "data": {"from_node": "aggregatespatial1"}, + "format": "JSON", + }, + }, + "saveresult2": { + "process_id": "save_result", + "arguments": { + "data": {"from_node": "saveresult1"}, + "format": "CSV", + }, + "result": True, + }, + } + } + + run_job(job_spec, output_file=tmp_path / "out", metadata_file=tmp_path / "job_metadata.json", + api_version="1.0.0", job_dir="./", dependencies=[], user_id="jenkins") + + output_files = os.listdir(tmp_path) + + assert "timeseries.json" in output_files + assert "timeseries.csv" in output_files