diff --git a/tests/test_efas.py b/tests/test_efas.py index 42f7bd6..0cbc6f3 100644 --- a/tests/test_efas.py +++ b/tests/test_efas.py @@ -3,6 +3,7 @@ from itertools import product as cart_prod from logging import getLogger from pathlib import Path +from types import MappingProxyType from unittest.mock import AsyncMock from unittest.mock import patch from zipfile import ZipFile @@ -56,6 +57,8 @@ class EfasLikeFileGenerator: the EFAS archive. """ + COMPRESSION = MappingProxyType({"zlib": True, "complevel": 4}) + def __init__( self, tmp_path: Path, @@ -118,7 +121,12 @@ def create(self, output_file: Path): dataset = xr.Dataset({"dis06": data}) nc_path = self._tmp_path / "data_operational-version-5.nc" - dataset.to_netcdf(nc_path) + dataset.to_netcdf( + nc_path, + encoding={ + v: EfasLikeFileGenerator.COMPRESSION for v in dataset.data_vars + }, + ) with ZipFile(output_file, "w") as zip_file: zip_file.write(nc_path, arcname=nc_path.name)