#NEWLINE# def test_update_actions_in_job_action_id_found_and_different_action( self ) : #NEWLINE# #INDENT# self . resource . get_action = Mock ( ) #NEWLINE# action_doc = { #NEWLINE# #INDENT# 'action_id' : 'ottonero' , #NEWLINE# 'freezer_action' : { #NEWLINE# #INDENT# 'mode' : 'mysql' , #NEWLINE# 'container' : 'freezer_backup_test' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'max_retries' : 3 , #NEWLINE# #UNINDENT# } #NEWLINE# job_doc = { #NEWLINE# #INDENT# 'job_actions' : [ action_doc . copy ( ) ] , #NEWLINE# 'description' : 'three actions backup' , #NEWLINE# #UNINDENT# } #NEWLINE# found_action = { #NEWLINE# #INDENT# 'action_id' : 'ottonero' , #NEWLINE# 'freezer_action' : { #NEWLINE# #INDENT# 'mode' : 'mysql' , #NEWLINE# 'container' : 'different_drum' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'max_retries' : 4 , #NEWLINE# #UNINDENT# } #NEWLINE# new_doc = action_doc . copy ( ) #NEWLINE# new_doc [ 'action_id' ] = '' #NEWLINE# self . resource . get_action . return_value = job_doc #NEWLINE# self . resource . update_actions_in_job ( 'duder' , job_doc = job_doc ) #NEWLINE# self . mock_db . add_action . assert_called_with ( user_id = 'duder' , doc = new_doc )