diff --git a/cubed_xarray/tests/test_wrapping.py b/cubed_xarray/tests/test_wrapping.py new file mode 100644 index 0000000..00cbed9 --- /dev/null +++ b/cubed_xarray/tests/test_wrapping.py @@ -0,0 +1,22 @@ +import xarray as xr +from xarray.core.parallelcompat import list_chunkmanagers +import cubed + +from cubed_xarray.cubedmanager import CubedManager + + +class TestDiscoverCubedManager: + def test_list_cubedmanager(self): + chunkmanagers = list_chunkmanagers() + assert 'cubed' in chunkmanagers + assert isinstance(chunkmanagers['cubed'], CubedManager) + + def test_chunk(self): + da = xr.DataArray([1, 2], dims='x') + chunked = da.chunk(x=1, chunked_array_type='cubed') + assert isinstance(chunked.data, cubed.Array) + assert chunked.chunksizes == {'x': (1, 1)} + + # TODO test cubed is default when dask not installed + + # TODO test dask is default over cubed when both installed