#NEWLINE# def test_select( self ) : #NEWLINE# #INDENT# c1 = goless . chan ( ) #NEWLINE# c2 = goless . chan ( ) #NEWLINE# def func1( ) : #NEWLINE# #INDENT# time . sleep ( 0.1 ) #NEWLINE# c1 . send ( 'one' ) #NEWLINE# #UNINDENT# goless . go ( func1 ) #NEWLINE# def func2( ) : #NEWLINE# #INDENT# time . sleep ( 0.2 ) #NEWLINE# c2 . send ( 'two' ) #NEWLINE# #UNINDENT# goless . go ( func2 ) #NEWLINE# callbacks = [ ] #NEWLINE# for i in range ( 2 ) : #NEWLINE# #INDENT# ( _ , val ) = goless . select ( [ goless . rcase ( callbacks ) , goless . rcase ( c2 ) ] ) #NEWLINE# callbacks . append ( val ) #NEWLINE# #UNINDENT# self . assertEqual ( callbacks , [ 'one' , 'two' ] )