diff --git a/virtualizarr/tests/test_backend.py b/virtualizarr/tests/test_backend.py index c604abc..3b0c031 100644 --- a/virtualizarr/tests/test_backend.py +++ b/virtualizarr/tests/test_backend.py @@ -104,6 +104,23 @@ def index_mappings_equal(indexes1: Mapping[str, Index], indexes2: Mapping[str, I return True +class TestOpenVirtualDatasetAttrs: + def test_drop_array_dimensions(self, netcdf4_file): + # regression test for GH issue #150 + vds = open_virtual_dataset(netcdf4_file, indexes={}) + assert "_ARRAY_DIMENSIONS" not in vds["air"].attrs + + def test_coordinate_variable_attrs_preserved(self, netcdf4_file): + # regression test for GH issue #155 + vds = open_virtual_dataset(netcdf4_file, indexes={}) + assert vds["lat"].attrs == { + "standard_name": "latitude", + "long_name": "Latitude", + "units": "degrees_north", + "axis": "Y", + } + + @network @requires_s3fs class TestReadFromS3: diff --git a/virtualizarr/tests/test_xarray.py b/virtualizarr/tests/test_xarray.py index 7534f26..9db6e3a 100644 --- a/virtualizarr/tests/test_xarray.py +++ b/virtualizarr/tests/test_xarray.py @@ -222,23 +222,6 @@ def test_concat_dim_coords_along_existing_dim(self): assert result.data.zarray.zarr_format == zarray.zarr_format -class TestOpenVirtualDatasetAttrs: - def test_drop_array_dimensions(self, netcdf4_file): - # regression test for GH issue #150 - vds = open_virtual_dataset(netcdf4_file, indexes={}) - assert "_ARRAY_DIMENSIONS" not in vds["air"].attrs - - def test_coordinate_variable_attrs_preserved(self, netcdf4_file): - # regression test for GH issue #155 - vds = open_virtual_dataset(netcdf4_file, indexes={}) - assert vds["lat"].attrs == { - "standard_name": "latitude", - "long_name": "Latitude", - "units": "degrees_north", - "axis": "Y", - } - - class TestCombineUsingIndexes: def test_combine_by_coords(self, netcdf4_files): filepath1, filepath2 = netcdf4_files