Skip to content

Commit 12ef3e5

Browse files
committed
Fix test for numcodecs 0.13
1 parent 897d4c3 commit 12ef3e5

File tree

1 file changed

+13
-21
lines changed

1 file changed

+13
-21
lines changed

zarr/tests/test_meta.py

+13-21
Original file line numberDiff line numberDiff line change
@@ -282,36 +282,28 @@ def test_encode_decode_array_dtype_shape_v3(cname):
282282
fill_value=None,
283283
chunk_memory_layout="C",
284284
)
285-
286-
meta_json = (
287-
"""{
285+
meta_expected = {
288286
"attributes": {},
289-
"chunk_grid": {
290-
"chunk_shape": [10],
291-
"separator": "/",
292-
"type": "regular"
293-
},
287+
"chunk_grid": {"chunk_shape": [10], "separator": "/", "type": "regular"},
294288
"chunk_memory_layout": "C",
295289
"compressor": {
296-
"""
297-
+ f"""
298-
"codec": "https://purl.org/zarr/spec/codec/{cname}/1.0",
299-
"""
300-
+ """
301-
"configuration": {
302-
"level": 1
303-
}
290+
"codec": f"https://purl.org/zarr/spec/codec/{cname}/1.0",
291+
"configuration": {"level": 1},
304292
},
305293
"data_type": "<f8",
306294
"extensions": [],
307-
"fill_value": null,
308-
"shape": [100, 10, 10 ]
309-
}"""
310-
)
295+
"fill_value": None,
296+
"shape": [100, 10, 10],
297+
}
298+
299+
if cname == "zstd":
300+
meta_expected["compressor"]["configuration"]["checksum"] = False
301+
302+
meta_expected_json = json.dumps(meta_expected)
311303

312304
# test encoding
313305
meta_enc = Metadata3.encode_array_metadata(meta)
314-
assert_json_equal(meta_json, meta_enc)
306+
assert_json_equal(meta_enc, meta_expected_json)
315307

316308
# test decoding
317309
meta_dec = Metadata3.decode_array_metadata(meta_enc)

0 commit comments

Comments
 (0)