Skip to content

Commit a38f25e

Browse files
committed
add testcase for test_codec_requires_endian
1 parent d46176e commit a38f25e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/test_metadata/test_v3.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,9 @@ def test_codec_requires_endian() -> None:
463463
ArrayV3Metadata.from_dict(
464464
default_metadata_dict(data_type="int16", codecs=bytes_codec_no_conf)
465465
)
466+
# no error for single-byte data types
467+
ArrayV3Metadata.from_dict(default_metadata_dict(data_type="int8", codecs=bytes_codec_no_conf))
468+
466469
bytes_codec_empty_conf = [{"name": "bytes", "configuration": {}}]
467470
with pytest.raises(ValueError, match=raise_msg):
468471
ArrayV3Metadata.from_dict(
@@ -484,8 +487,11 @@ def test_codec_requires_endian() -> None:
484487
sharding_codec_no_endian = [
485488
{"name": "sharding_indexed", "configuration": {"chunk_shape": (1,)}}
486489
]
487-
488490
with pytest.raises(ValueError, match=raise_msg):
489491
ArrayV3Metadata.from_dict(
490492
default_metadata_dict(data_type="int16", codecs=sharding_codec_no_endian)
491493
)
494+
# no error for single-byte data types
495+
ArrayV3Metadata.from_dict(
496+
default_metadata_dict(data_type="int8", codecs=sharding_codec_no_endian)
497+
)

0 commit comments

Comments
 (0)