Skip to content

Commit c50839e

Browse files
committed
TEST: Test double collapse
1 parent 2e5e3bc commit c50839e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

nipype/pipeline/engine/tests/test_nodes.py

+15
Original file line numberDiff line numberDiff line change
@@ -290,3 +290,18 @@ def test_inputs_removal(tmpdir):
290290
n1.overwrite = True
291291
n1.run()
292292
assert not tmpdir.join(n1.name, 'file1.txt').check()
293+
294+
295+
def test_outputmultipath_collapse(tmpdir):
296+
"""Test an OutputMultiPath whose initial value is ``[[x]]`` to ensure that
297+
it is returned as ``[x]``, regardless of how accessed."""
298+
select_if = niu.Select(inlist=[[1, 2, 3], [4]], index=1)
299+
select_nd = pe.Node(niu.Select(inlist=[[1, 2, 3], [4]], index=1),
300+
name='select_nd')
301+
302+
ifres = select_if.run()
303+
ndres = select_nd.run()
304+
305+
assert ifres.outputs.out == [4]
306+
assert ndres.outputs.out == [4]
307+
assert select_nd.result.outputs.out == [4]

0 commit comments

Comments
 (0)