Skip to content

Commit 6dd54b2

Browse files
committed
TEST: Test attribute copying during MapNode expansion
1 parent f0f7e39 commit 6dd54b2

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

nipype/pipeline/engine/tests/test_engine.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,28 @@ def func1(in1):
486486
assert "can only concatenate list" in str(excinfo.value)
487487

488488

489+
def test_mapnode_expansion(tmpdir):
490+
os.chdir(str(tmpdir))
491+
from nipype import MapNode, Function
492+
493+
def func1(in1):
494+
return in1 + 1
495+
496+
mapnode = MapNode(Function(function=func1),
497+
iterfield='in1',
498+
name='mapnode')
499+
mapnode.inputs.in1 = [1, 2]
500+
mapnode.interface.num_threads = 2
501+
mapnode.interface.estimated_memory_gb = 2
502+
503+
for idx, node in mapnode._make_nodes():
504+
for attr in ('overwrite', 'run_without_submitting', 'plugin_args'):
505+
assert getattr(node, attr) == getattr(mapnode, attr)
506+
for attr in ('num_threads', 'estimated_memory_gb'):
507+
assert (getattr(node._interface, attr) ==
508+
getattr(mapnode._interface, attr))
509+
510+
489511
def test_node_hash(tmpdir):
490512
wd = str(tmpdir)
491513
os.chdir(wd)

0 commit comments

Comments
 (0)