Skip to content

Commit 6b2c39a

Browse files
author
Martin Durant
committed
cover
1 parent cd0f96f commit 6b2c39a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

zarr/tests/test_storage.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,28 @@ def test_s3(self):
923923

924924
assert g.data[:].tolist() == [0, 1, 2, 3, 0, 0, 0, 0]
925925

926+
@pytest.mark.usefixtures("s3")
927+
def test_s3_complex(self):
928+
import zarr
929+
g = zarr.open_group("s3://test/out.zarr", mode='w',
930+
storage_options=self.s3so)
931+
expected = np.empty((8, 8, 8), dtype='int64')
932+
expected[:] = -1
933+
a = g.create_dataset("data", shape=(8, 8, 8),
934+
fill_value=-1)
935+
expected[0] = 0
936+
expected[3] = 3
937+
a[:4] = expected[:4]
938+
939+
a = g.create_dataset("data_f", shape=(8, ),
940+
dtype=[('foo', 'S3'), ('bar', 'i4')])
941+
a['foo'] = b"aaa"
942+
g = zarr.open_group("s3://test/out.zarr", mode='r',
943+
storage_options=self.s3so)
944+
945+
assert (g.data[:] == expected).all()
946+
assert g.data_f['foo'].tolist() == [b"aaa"] * 8
947+
926948

927949
@pytest.fixture()
928950
def s3(request):

0 commit comments

Comments
 (0)