def test_unique_join_node(tmpdir):
 global _sum_operands
 _sum_operands = []
 os.chdir(str(tmpdir))
 wf = pe.Workflow(name=u'test')
 inputspec = pe.Node(IdentityInterface(fields=[u'n']), name=u'inputspec')
 inputspec.iterables = [(u'n', [3, 1, 2, 1, 3])]
 pre_join1 = pe.Node(IncrementInterface(), name=u'pre_join1')
 wf.connect(inputspec, u'n', pre_join1, u'input1')
 join = pe.JoinNode(SumInterface(), joinsource=u'inputspec', joinfield=u'input1', unique=True, name=u'join')
 wf.connect(pre_join1, u'output1', join, u'input1')
 wf.run()
 assert (_sum_operands[0] == [4, 2, 3]), (u'The unique join output value is incorrect: %s.' % _sum_operands[0])

def test_unique_join_node ( tmpdir ) : global _sum_operands _sum_operands = [ ] os . chdir ( str ( tmpdir ) ) wf = pe . Workflow ( name = u'test' ) inputspec = pe . Node ( IdentityInterface ( fields = [ u'n' ] ) , name = u'inputspec' ) inputspec . iterables = [ ( u'n' , [ 3 , 1 , 2 , 1 , 3 ] ) ] pre_join1 = pe . Node ( IncrementInterface ( ) , name = u'pre_join1' ) wf . connect ( inputspec , u'n' , pre_join1 , u'input1' ) join = pe . JoinNode ( SumInterface ( ) , joinsource = u'inputspec' , joinfield = u'input1' , unique = True , name = u'join' ) wf . connect ( pre_join1 , u'output1' , join , u'input1' ) wf . run ( ) assert ( _sum_operands [ 0 ] == [ 4 , 2 , 3 ] ) , ( u'The unique join output value is incorrect: %s.' % _sum_operands [ 0 ] )
test join with the unique flag set to true .