Skip to content

Commit fd24535

Browse files
committed
Add test for SelectFiles field parsing
1 parent d7ef91a commit fd24535

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

nipype/interfaces/tests/test_io.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import os.path as op
1212
from subprocess import Popen
1313
import hashlib
14+
from collections import namedtuple
1415

1516
import pytest
1617
import nipype
@@ -62,6 +63,7 @@ def test_s3datagrabber():
6263
templates1 = {"model": "interfaces/{package}/model.py",
6364
"preprocess": "interfaces/{package}/pre*.py"}
6465
templates2 = {"converter": "interfaces/dcm{to!s}nii.py"}
66+
templates3 = {"model": "interfaces/{package.name}/model.py"}
6567

6668
@pytest.mark.parametrize("SF_args, inputs_att, expected", [
6769
({"templates":templates1}, {"package":"fsl"},
@@ -75,6 +77,11 @@ def test_s3datagrabber():
7577
7678
({"templates":templates2}, {"to":2},
7779
{"infields":["to"], "outfields":["converter"], "run_output":{"converter":op.join(op.dirname(nipype.__file__), "interfaces/dcm2nii.py")}, "node_output":["converter"]}),
80+
81+
({"templates": templates3}, {"package": namedtuple("package", ["name"])("fsl")},
82+
{"infields": ["package"], "outfields": ["model"],
83+
"run_output": {"model": op.join(op.dirname(nipype.__file__), "interfaces/fsl/model.py")},
84+
"node_output": ["model"]}),
7885
])
7986
def test_selectfiles(SF_args, inputs_att, expected):
8087
base_dir = op.dirname(nipype.__file__)

0 commit comments

Comments
 (0)