Skip to content

Commit 1d424c0

Browse files
committed
add tests for numcodecs compatibility
1 parent a367268 commit 1d424c0

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/test_codecs/test_numcodecs.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from __future__ import annotations
2+
3+
from numcodecs import GZip
4+
5+
from zarr.codecs._numcodecs import get_numcodec
6+
from zarr.codecs._v2 import _is_numcodec, _is_numcodec_cls
7+
8+
9+
def test_get_numcodec() -> None:
10+
assert get_numcodec({"id": "gzip", "level": 2}) == GZip(level=2)
11+
12+
13+
def test_is_numcodec() -> None:
14+
"""
15+
Test the _is_numcodec function
16+
"""
17+
assert _is_numcodec(GZip())
18+
19+
20+
def test_is_numcodec_cls() -> None:
21+
"""
22+
Test the _is_numcodec_cls function
23+
"""
24+
assert _is_numcodec_cls(GZip)

0 commit comments

Comments
 (0)