def test_save_errors(): with pytest.raises(ValueError): # no arrays provided save_group('data/group.zarr') with pytest.raises(ValueError): # no arrays provided save('data/group.zarr')
def test_save_errors(): with assert_raises(ValueError): # no arrays provided save_group('data/group.zarr') with assert_raises(ValueError): # no arrays provided save('data/group.zarr')
def test_save_errors(zarr_version): with pytest.raises(ValueError): # no arrays provided save_group('data/group.zarr', zarr_version=zarr_version) with pytest.raises(TypeError): # no array provided save_array('data/group.zarr', zarr_version=zarr_version) with pytest.raises(ValueError): # no arrays provided save('data/group.zarr', zarr_version=zarr_version)
def test_zarr_v3_save_errors(): x = np.ones(8) with pytest.raises(ValueError): # no path provided save_group('data/group.zr3', x, zarr_version=3) with pytest.raises(ValueError): # no path provided save_array('data/group.zr3', x, zarr_version=3) with pytest.raises(ValueError): # no path provided save('data/group.zr3', x, zarr_version=3)
def test_zarr_v3_save_multiple_unnamed(): x = np.ones(8) y = np.zeros(8) store = KVStoreV3(dict()) # no path provided save_group(store, x, y, path='dataset', zarr_version=3) # names become arr_{i} for unnamed *args assert data_root + 'dataset/arr_0/c0' in store assert data_root + 'dataset/arr_1/c0' in store assert meta_root + 'dataset/arr_0.array.json' in store assert meta_root + 'dataset/arr_1.array.json' in store