@@ -34,27 +34,27 @@ def _list_outputs(self):
34
34
return outputs
35
35
36
36
37
- # def test_run_multiproc():
38
- # cur_dir = os.getcwd()
39
- # temp_dir = mkdtemp(prefix='test_engine_')
40
- # os.chdir(temp_dir)
41
- #
42
- # pipe = pe.Workflow(name='pipe')
43
- # mod1 = pe.Node(interface=TestInterface(), name='mod1')
44
- # mod2 = pe.MapNode(interface=TestInterface(),
45
- # iterfield=['input1'],
46
- # name='mod2')
47
- # pipe.connect([(mod1, mod2, [('output1', 'input1')])])
48
- # pipe.base_dir = os.getcwd()
49
- # mod1.inputs.input1 = 1
50
- # pipe.config['execution']['poll_sleep_duration'] = 2
51
- # execgraph = pipe.run(plugin="MultiProc")
52
- # names = ['.'.join((node._hierarchy, node.name)) for node in execgraph.nodes()]
53
- # node = execgraph.nodes()[names.index('pipe.mod1')]
54
- # result = node.get_output('output1')
55
- # yield assert_equal, result, [1, 1]
56
- # os.chdir(cur_dir)
57
- # rmtree(temp_dir)
37
+ def test_run_multiproc ():
38
+ cur_dir = os .getcwd ()
39
+ temp_dir = mkdtemp (prefix = 'test_engine_' )
40
+ os .chdir (temp_dir )
41
+
42
+ pipe = pe .Workflow (name = 'pipe' )
43
+ mod1 = pe .Node (interface = TestInterface (), name = 'mod1' )
44
+ mod2 = pe .MapNode (interface = TestInterface (),
45
+ iterfield = ['input1' ],
46
+ name = 'mod2' )
47
+ pipe .connect ([(mod1 , mod2 , [('output1' , 'input1' )])])
48
+ pipe .base_dir = os .getcwd ()
49
+ mod1 .inputs .input1 = 1
50
+ pipe .config ['execution' ]['poll_sleep_duration' ] = 2
51
+ execgraph = pipe .run (plugin = "MultiProc" )
52
+ names = ['.' .join ((node ._hierarchy , node .name )) for node in execgraph .nodes ()]
53
+ node = execgraph .nodes ()[names .index ('pipe.mod1' )]
54
+ result = node .get_output ('output1' )
55
+ yield assert_equal , result , [1 , 1 ]
56
+ os .chdir (cur_dir )
57
+ rmtree (temp_dir )
58
58
59
59
60
60
class InputSpecSingleNode (nib .TraitedSpec ):
0 commit comments