#NEWLINE# def testMap( self ) : #NEWLINE# #INDENT# def f( x ) : #NEWLINE# #INDENT# time . sleep ( ( random . random ( ) * 0.01 ) ) #NEWLINE# return ( x + 1 ) #NEWLINE# #UNINDENT# self . assertEquals ( self . scheduler . map ( f , [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ] ) , [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ] ) #NEWLINE# def g( x ) : #NEWLINE# #INDENT# time . sleep ( ( random . random ( ) * 0.01 ) ) #NEWLINE# return self . scheduler . map ( f , x ) #NEWLINE# #UNINDENT# self . assertEquals ( self . scheduler . map ( g , [ [ 0 , 1 , 2 ] , [ 3 , 4 , 5 ] , [ 6 , 7 , 8 ] ] ) , [ [ 1 , 2 , 3 ] , [ 4 , 5 , 6 ] , [ 7 , 8 , 9 ] ] )