def test_set_join_node_file_input(tmpdir):
 wd = str(tmpdir)
 os.chdir(wd)
 open(u'test.nii', u'w+').close()
 open(u'test2.nii', u'w+').close()
 wf = pe.Workflow(name=u'test')
 inputspec = pe.Node(IdentityInterface(fields=[u'n']), name=u'inputspec')
 inputspec.iterables = [(u'n', [os.path.join(wd, u'test.nii'), os.path.join(wd, u'test2.nii')])]
 pre_join1 = pe.Node(IdentityInterface(fields=[u'n']), name=u'pre_join1')
 wf.connect(inputspec, u'n', pre_join1, u'n')
 join = pe.JoinNode(PickFirst(), joinsource=u'inputspec', joinfield=u'in_files', name=u'join')
 wf.connect(pre_join1, u'n', join, u'in_files')
 wf.run()

def test_set_join_node_file_input ( tmpdir ) : wd = str ( tmpdir ) os . chdir ( wd ) open ( u'test.nii' , u'w+' ) . close ( ) open ( u'test2.nii' , u'w+' ) . close ( ) wf = pe . Workflow ( name = u'test' ) inputspec = pe . Node ( IdentityInterface ( fields = [ u'n' ] ) , name = u'inputspec' ) inputspec . iterables = [ ( u'n' , [ os . path . join ( wd , u'test.nii' ) , os . path . join ( wd , u'test2.nii' ) ] ) ] pre_join1 = pe . Node ( IdentityInterface ( fields = [ u'n' ] ) , name = u'pre_join1' ) wf . connect ( inputspec , u'n' , pre_join1 , u'n' ) join = pe . JoinNode ( PickFirst ( ) , joinsource = u'inputspec' , joinfield = u'in_files' , name = u'join' ) wf . connect ( pre_join1 , u'n' , join , u'in_files' ) wf . run ( )
test collecting join inputs to a set .