#NEWLINE# def _test_actions_with_locked_instance( self , actions , method_translations = None , body_map = None , args_map = None ) : #NEWLINE# #INDENT# method_translations = ( method_translations or { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# body_map = ( body_map or { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# args_map = ( args_map or { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# for action in actions : #NEWLINE# #INDENT# method = method_translations . get ( action ) #NEWLINE# body = body_map . get ( action ) #NEWLINE# self . mox . StubOutWithMock ( self . compute_api , ( method or action . replace ( '_' , '' ) ) ) #NEWLINE# self . _test_locked_instance ( action , method = method , body = body , compute_api_args_map = args_map ) #NEWLINE# self . mox . StubOutWithMock ( self . compute_api , 'get' )