Skip to content

Commit 8c7e1eb

Browse files
committed
TEST: Added testing for errors
Minor updates to tests to check error handling
1 parent 04df389 commit 8c7e1eb

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

nibabel/tests/test_brikhead.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ def test_brikheadfile(self):
103103
data = brik.get_data()
104104
assert_equal(data.shape, tp['shape'])
105105
assert_array_equal(brik.dataobj.scaling, tp['scaling'])
106+
assert_equal(brik.header.get_volume_labels(), tp['labels'])
106107

107108
def test_load(self):
108109
# Check highest level load of brikhead works
@@ -136,3 +137,14 @@ def test_brikheadfile(self):
136137
for tp in self.test_files:
137138
with assert_raises(tp['err']):
138139
self.module.load(tp['head'])
140+
141+
142+
class TestBadVars(object):
143+
module = brikhead
144+
vars = ['type = badtype-attribute\nname = BRICK_TYPES\ncount = 1\n1\n',
145+
'type = integer-attribute\ncount = 1\n1\n']
146+
147+
def test_unpack_var(self):
148+
for var in self.vars:
149+
with assert_raises(self.module.AFNIHeaderError):
150+
self.module._unpack_var(var)

0 commit comments

Comments
 (0)