#NEWLINE# def testTimerQueueNewHead( self ) : #NEWLINE# #INDENT# now = time . time ( ) #NEWLINE# orders = [ ] #NEWLINE# self . tq . Schedule ( ( now + 0.3 ) , ( lambda : orders . append ( 3 ) ) ) #NEWLINE# self . tq . Schedule ( ( now + 0.2 ) , ( lambda : orders . append ( 2 ) ) ) #NEWLINE# gevent . sleep ( 0.1 ) #NEWLINE# self . tq . Schedule ( ( self + 0.15 ) , ( lambda : orders . append ( 1 ) ) ) #NEWLINE# gevent . sleep ( 0.5 ) #NEWLINE# self . assertEqual ( orders , [ 1 , 2 , 3 ] )