#NEWLINE# def test_multiple_producers( self ) : #NEWLINE# #INDENT# messages = [ ] #NEWLINE# sources = [ ] #NEWLINE# def f( ) : #NEWLINE# #INDENT# while True : #NEWLINE# #INDENT# ( source , msg ) = receive ( ) #NEWLINE# if ( not msg ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# if ( source . ref not in sources ) : #NEWLINE# #INDENT# sources . append ( source . ref ) #NEWLINE# #UNINDENT# messages . append ( msg ) #NEWLINE# #UNINDENT# #UNINDENT# def f1( ref ) : #NEWLINE# #INDENT# msg = [ 'hello' , 'world' ] #NEWLINE# for s in msg : #NEWLINE# #INDENT# send ( ref , s ) #NEWLINE# #UNINDENT# #UNINDENT# def f2( ref ) : #NEWLINE# #INDENT# msg = [ 'brave' , 'new' , 'world' , '' ] #NEWLINE# for s in msg : #NEWLINE# #INDENT# send ( ref , s ) #NEWLINE# #UNINDENT# #UNINDENT# pid0 = spawn ( f1 ) #NEWLINE# pid1 = spawn ( f1 , pid0 ) #NEWLINE# pid2 = spawn ( f2 , pid0 ) #NEWLINE# core . run ( ) #NEWLINE# assert ( len ( messages ) == 5 ) #NEWLINE# assert ( sources == [ 5 , 6 ] )