Skip to content

Commit 2e0f91c

Browse files
committed
TEST: Verify writing to loaded data array fails
1 parent b58e204 commit 2e0f91c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

nibabel/gifti/tests/test_parse_gifti_fast.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,13 @@ def test_readwritedata():
268268
assert_array_almost_equal(img.darrays[0].data,
269269
img2.darrays[0].data)
270270

271+
def test_modify_darray():
272+
for fname in (DATA_FILE1, DATA_FILE2, DATA_FILE5):
273+
img = load(fname)
274+
darray = img.darrays[0]
275+
darray.data[:] = 0
276+
yield assert_array_almost_equal, darray.data, np.broadcast_to(0, darray.data.shape)
277+
271278

272279
def test_write_newmetadata():
273280
img = gi.GiftiImage()

0 commit comments

Comments
 (0)