From 46d0c8f349dac063c5523b267874eff5182b1562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Mari=C4=87?= <5569474+zoltanmaric@users.noreply.github.com> Date: Wed, 16 Nov 2022 15:54:41 +0100 Subject: [PATCH] Failing test for #190 --- test/test_preparation_and_conversion.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/test/test_preparation_and_conversion.py b/test/test_preparation_and_conversion.py index 522a8be8..48cb8e5a 100755 --- a/test/test_preparation_and_conversion.py +++ b/test/test_preparation_and_conversion.py @@ -42,7 +42,7 @@ def all_notnull_test(cutout): def prepared_features_test(cutout): """ - The prepared features series should contain all variables in cuttout.data + The prepared features series should contain all variables in cutout.data """ assert set(cutout.prepared_features) == set(cutout.data) @@ -306,6 +306,16 @@ def cutout_era5(tmp_path_factory): return cutout +@pytest.fixture(scope="session") +def cutout_mixed_era5_and_era5t(tmp_path_factory): + # Try just getting Berlin + # Try just requesting era5 and era5t + tmp_path = tmp_path_factory.mktemp("era5_era5t") + cutout = Cutout(path=tmp_path / "era5_era5t", module="era5", bounds=BOUNDS, time=slice("2022-09-01", "2022-10-31")) + cutout.prepare() + return cutout + + @pytest.fixture(scope="session") def cutout_era5_3h_sampling(tmp_path_factory): tmp_path = tmp_path_factory.mktemp("era5") @@ -429,7 +439,7 @@ class TestERA5: @staticmethod def test_data_module_arguments_era5(cutout_era5): """ - All data variables should have an attribute to which module thay belong + All data variables should have an attribute to which module they belong """ for v in cutout_era5.data: assert cutout_era5.data.attrs["module"] == "era5" @@ -526,6 +536,10 @@ def test_pv_era5_3h_sampling(cutout_era5_3h_sampling): assert pd.infer_freq(cutout_era5_3h_sampling.data.time) == "3H" return pv_test(cutout_era5_3h_sampling) + @staticmethod + def test_pv_era5(cutout_mixed_era5_and_era5t): + return pv_test(cutout_mixed_era5_and_era5t, time="2022-10-31") + @staticmethod def test_wind_era5(cutout_era5): return wind_test(cutout_era5)