Skip to content

Commit dcf9566

Browse files
committed
TEST: Check None and invalid order arguments
1 parent 3cfe337 commit dcf9566

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

nibabel/tests/test_arrayproxy.py

+5
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ def test_init():
8888
assert ap.shape != shape
8989
# Data stays the same, also
9090
assert_array_equal(np.asarray(ap), arr)
91+
# You wouldn't do this, but order=None explicitly requests the default order
92+
ap2 = ArrayProxy(bio, FunkyHeader(arr.shape), order=None)
93+
assert_array_equal(np.asarray(ap2), arr)
9194
# C order also possible
9295
bio = BytesIO()
9396
bio.seek(16)
@@ -97,6 +100,8 @@ def test_init():
97100
# Illegal init
98101
with pytest.raises(TypeError):
99102
ArrayProxy(bio, object())
103+
with pytest.raises(ValueError):
104+
ArrayProxy(bio, hdr, order='badval')
100105

101106

102107
def test_tuplespec():

0 commit comments

Comments
 (0)