Skip to content

Commit 95f00a7

Browse files
committed
add test for niu.Split
1 parent 8ce3629 commit 95f00a7

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

nipype/interfaces/tests/test_utility.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,28 @@ def test_function_with_imports():
113113
finally:
114114
os.chdir(origdir)
115115
shutil.rmtree(tempdir)
116+
117+
118+
def test_split():
119+
tempdir = os.path.realpath(mkdtemp())
120+
origdir = os.getcwd()
121+
os.chdir(tempdir)
122+
123+
try:
124+
node = pe.Node(utility.Split(inlist=range(4),
125+
splits=[1, 3]),
126+
name='split_squeeze')
127+
res = node.run()
128+
yield assert_equal, res.outputs.out1, [0]
129+
yield assert_equal, res.outputs.out2, [1, 2, 3]
130+
131+
node = pe.Node(utility.Split(inlist=range(4),
132+
splits=[1, 3],
133+
squeeze=True),
134+
name='split_squeeze')
135+
res = node.run()
136+
yield assert_equal, res.outputs.out1, 0
137+
yield assert_equal, res.outputs.out2, [1, 2, 3]
138+
finally:
139+
os.chdir(origdir)
140+
shutil.rmtree(tempdir)

0 commit comments

Comments
 (0)