new data copy test

This commit is contained in:
Benoît Sierro
2023-08-09 11:38:41 +02:00
parent ea8bc0360d
commit 0e24d85606

View File

@@ -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)