#NEWLINE# def testMultiNestedOp( self ) : #NEWLINE# #INDENT# 'Test nested op within nested op.' #NEWLINE# @ gen . coroutine #NEWLINE# def _InnererMethod( client , arg3 ) : #NEWLINE# #INDENT# self . assertTrue ( Operation . GetCurrent ( ) . operation_id . startswith ( '++' ) ) #NEWLINE# self . assertEqual ( arg3 , 3 ) #NEWLINE# self . _method_count += 1 #NEWLINE# #UNINDENT# @ gen . coroutine #NEWLINE# def _InnerMethod( client , arg2 ) : #NEWLINE# #INDENT# self . assertEqual ( arg2 , 2 ) #NEWLINE# self . _method_count += 1 #NEWLINE# if ( self . _method_count == 2 ) : #NEWLINE# #INDENT# ( yield Operation . CreateNested ( client , '_InnererMethod' , { #NEWLINE# #INDENT# 'arg3' : 3 , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# #UNINDENT# #UNINDENT# @ gen . coroutine #NEWLINE# def _OuterMethod( client , arg1 ) : #NEWLINE# #INDENT# self . assertEqual ( arg1 , 1 ) #NEWLINE# self . _method_count += 1 #NEWLINE# if ( self . _method_count == 1 ) : #NEWLINE# #INDENT# ( yield Operation . CreateNested ( client , '_InnerMethod' , { #NEWLINE# #INDENT# 'arg2' : 2 , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# #UNINDENT# #UNINDENT# op_mgr = self . _CreateOpManager ( handlers = [ _OuterMethod , _InnerMethod , _InnererMethod ] ) #NEWLINE# OpManager . SetInstance ( op_mgr ) #NEWLINE# outer_op = self . _CreateTestOp ( user_id = 1 , handler = _OuterMethod , arg1 = 1 ) #NEWLINE# self . _RunAsync ( op_mgr . WaitForUserOps , self . _client , 1 ) #NEWLINE# self . assertEqual ( self . _method_count , 5 )