From 0e24d85606ca4be090f819f87c1908cf4f6b5790 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Sierro?= Date: Wed, 9 Aug 2023 11:38:41 +0200 Subject: [PATCH] new data copy test --- tests/test_io_handlers.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/test_io_handlers.py b/tests/test_io_handlers.py index deec0d9..f712d59 100644 --- a/tests/test_io_handlers.py +++ b/tests/test_io_handlers.py @@ -116,6 +116,20 @@ def test_overwrite(tmp_path: Path): assert len(zpath.read_bytes()) == len(orig_file) +def test_zip_data_copy(tmp_path: Path): + new_disp_path = Path("./tests/data/PM2000D_2 extrapolated 4 0.npz") + new_aeff_path = Path("./tests/data/PM2000D_A_eff_marcuse.npz") + params = Parameters( + **(PARAMS | dict(dispersion_file=new_disp_path, effective_area_file=new_aeff_path)) + ) + _ = propagation(tmp_path / "file.zip", params, bundle_data=True) + + prop = propagation(tmp_path / "file.zip") + + assert prop.parameters.effective_area_file.load_data() == new_aeff_path.read_bytes() + assert prop.parameters.dispersion_file.load_data() == new_disp_path.read_bytes() + + def test_zip_bundle(tmp_path: Path): params = Parameters(**PARAMS)