Skip to content

Commit

Permalink
Merge pull request #5 from TomNicholas/tests
Browse files Browse the repository at this point in the history
Initial tests
  • Loading branch information
TomNicholas authored May 9, 2023
2 parents 669970c + 1a22c49 commit 3f2a2f0
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions cubed_xarray/tests/test_wrapping.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 3f2a2f0

Please sign in to comment.