Skip to content

Commit 9510a5e

Browse files
committed
update codec tests
1 parent 56ad592 commit 9510a5e

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

tests/test_codecs/test_adler32.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,13 @@
77
@pytest.mark.filterwarnings("ignore::zarr.errors.ZarrUserWarning")
88
class TestAdler32Codec(BaseTestCodec):
99
test_cls = _numcodecs.Adler32
10-
valid_json_v2 = ({"id": "adler32"},)
11-
valid_json_v3 = ({"name": "adler32", "configuration": {}},)
10+
valid_json_v2 = (
11+
{"id": "adler32"},
12+
{"id": "adler32", "location": "start"},
13+
{"id": "adler32", "location": "end"},
14+
)
15+
valid_json_v3 = (
16+
{"name": "adler32", "configuration": {}},
17+
{"name": "adler32", "configuration": {"location": "start"}},
18+
{"name": "adler32", "configuration": {"location": "end"}},
19+
)

tests/test_codecs/test_zstd.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,14 @@ class TestZstdCodec(BaseTestCodec):
3333

3434
def test_checksum_removed(self) -> None:
3535
"""
36-
Test that the checksum field is not serialized to Zarr V2 JSON
36+
Test that the checksum field is not serialized to Zarr V2 JSON when it is False
3737
"""
3838
codec = self.test_cls(checksum=False)
3939
assert "checksum" not in codec.to_json(zarr_format=2)
4040

41+
codec = self.test_cls(checksum=True)
42+
assert codec.to_json(zarr_format=2)["checksum"] is True
43+
4144

4245
@pytest.mark.parametrize("level", [1, 5, 9])
4346
@pytest.mark.parametrize("checksum", [True, False])

0 commit comments

Comments
 (0)