#NEWLINE# def test_finite_scheduler( self ) : #NEWLINE# #INDENT# def scheduler( ) : #NEWLINE# #INDENT# ( yield 3 ) #NEWLINE# ( yield 5 ) #NEWLINE# ( yield 8 ) #NEWLINE# #UNINDENT# tt = mm . Timer ( scheduler ( ) , self . callback , self . tag ) #NEWLINE# tt . start ( ) #NEWLINE# tt . join ( ) #NEWLINE# nt . assert_false ( tt . is_running ) #NEWLINE# nt . assert_equal ( self . callback . call_args_list , [ mock . call ( self . get_metrics . return_value ) , mock . call ( self . get_metrics . return_value ) , mock . call ( self . get_metrics . return_value ) ] ) #NEWLINE# nt . assert_equal ( self . time . current_time , 10 ) #NEWLINE# nt . assert_equal ( self . time . sleeps , [ 3 , 1 , 2 ] )