Skip to content

Commit b51ec36

Browse files
committed
TEST: Add some assertions and smoke tests to exercise methods
1 parent d4d42a0 commit b51ec36

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Diff for: nibabel/tests/test_coordimage.py

+15
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,18 @@ def test_Cifti2Image_as_CoordImage():
6666
dobj = ones.dataobj.copy()
6767
dobj.order = 'C' # Hack for image with BMA as the last axis
6868
cimg = ci.CoordinateImage(dobj, caxis, ones.header)
69+
70+
assert caxis[...] is caxis
71+
assert caxis[:] is caxis
72+
73+
subaxis = caxis[:100]
74+
assert len(subaxis) == 100
75+
assert len(subaxis.parcels) == 1
76+
subaxis = caxis[100:]
77+
assert len(subaxis) == len(caxis) - 100
78+
assert len(subaxis.parcels) == len(caxis.parcels)
79+
subaxis = caxis[100:-100]
80+
assert len(subaxis) == len(caxis) - 200
81+
assert len(subaxis.parcels) == len(caxis.parcels)
82+
83+
caxis.get_indices('CIFTI_STRUCTURE_CORTEX_LEFT')

0 commit comments

Comments
 (0)