#NEWLINE# def testMultipleOps( self ) : #NEWLINE# #INDENT# 'Test multiple operations executed by OpManager.' #NEWLINE# def _OpMethod( client , callback ) : #NEWLINE# #INDENT# self . _method_count += 1 #NEWLINE# callback ( ) #NEWLINE# if ( self . _method_count == 3 ) : #NEWLINE# #INDENT# self . io_loop . add_callback ( self . stop ) #NEWLINE# #UNINDENT# #UNINDENT# def _OnWait( ) : #NEWLINE# #INDENT# self . _wait_count += 1 #NEWLINE# #UNINDENT# op_mgr = self . _CreateOpManager ( handlers = [ _OpMethod ] ) #NEWLINE# op = self . _CreateTestOp ( user_id = 1 , handler = _OpMethod ) #NEWLINE# op_mgr . MaybeExecuteOp ( self . _client , op . user_id , op . operation_id , wait_callback = _OnWait ) #NEWLINE# op = self . _CreateTestOp ( user_id = 2 , handler = _OpMethod ) #NEWLINE# op_mgr . MaybeExecuteOp ( self . _client , op . user_id , op . operation_id ) #NEWLINE# op = self . _CreateTestOp ( user_id = 1 , handler = _OpMethod ) #NEWLINE# op_mgr . MaybeExecuteOp ( self . _client , op . user_id , op . operation_id ) #NEWLINE# self . wait ( ) #NEWLINE# self . assertEqual ( self . _wait_count , 1 ) #NEWLINE# self . _RunAsync ( op_mgr . Drain )