Skip to content

Commit 8b30127

Browse files
committed
Add test for SelectFiles force_lists error
1 parent a7c8871 commit 8b30127

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

nipype/interfaces/tests/test_io.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import os.path as op
77
from tempfile import mkstemp, mkdtemp
88

9+
from nose.tools import assert_raises
910
import nipype
1011
from nipype.testing import assert_equal, assert_true, assert_false
1112
import nipype.interfaces.io as nio
@@ -61,6 +62,17 @@ def test_selectfiles():
6162
yield assert_equal, res.outputs.converter, wanted
6263

6364

65+
def test_selectfiles_valueerror():
66+
"""Test ValueError when force_lists has field that isn't in template."""
67+
base_dir = op.dirname(nipype.__file__)
68+
templates = {"model": "interfaces/{package}/model.py",
69+
"preprocess": "interfaces/{package}/pre*.py"}
70+
force_lists = ["model", "preprocess", "registration"]
71+
sf = nio.SelectFiles(templates, base_directory=base_dir,
72+
force_lists=force_lists)
73+
yield assert_raises, ValueError, sf.run
74+
75+
6476
def test_datagrabber_order():
6577
tempdir = mkdtemp()
6678
file1 = mkstemp(prefix='sub002_L1_R1.q', dir=tempdir)

0 commit comments

Comments
 (0)