Skip to content

Commit 6a0ce9c

Browse files
committed
tst: added duration checking
1 parent 6771823 commit 6a0ce9c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

nipype/algorithms/tests/test_modelgen.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ def test_modelgen1():
3838
yield assert_equal, len(res.outputs.session_info[0]['regress']), 0
3939
yield assert_equal, len(res.outputs.session_info[0]['cond']), 1
4040
yield assert_almost_equal, np.array(res.outputs.session_info[0]['cond'][0]['onset']), np.array([12, 300, 600, 1080])
41+
info = [Bunch(conditions=['cond1'], onsets=[[2]], durations=[[1]]),
42+
Bunch(conditions=['cond1'], onsets=[[3]], durations=[[1]])]
43+
s.inputs.subject_info = deepcopy(info)
44+
res = s.run()
45+
yield assert_almost_equal, np.array(res.outputs.session_info[0]['cond'][0]['duration']), np.array([6.])
46+
yield assert_almost_equal, np.array(res.outputs.session_info[1]['cond'][0]['duration']), np.array([6.])
4147
rmtree(tempdir)
4248

4349

0 commit comments

Comments
 (0)