#NEWLINE# @ mock . patch . object ( sh , '_show_policy' ) #NEWLINE# def test_do_policy_update( self , mock_show ) : #NEWLINE# #INDENT# service = mock . Mock ( ) #NEWLINE# args = { #NEWLINE# #INDENT# 'name' : 'deletion_policy' , #NEWLINE# 'id' : 'policy_id' , #NEWLINE# #UNINDENT# } #NEWLINE# args = self . _make_args ( args ) #NEWLINE# params = { #NEWLINE# #INDENT# 'name' : 'deletion_policy' , #NEWLINE# #UNINDENT# } #NEWLINE# policy = mock . Mock ( ) #NEWLINE# service . get_policy . return_value = policy #NEWLINE# policy . id = 'policy_id' #NEWLINE# sh . do_policy_update ( service , args ) #NEWLINE# service . get_policy . assert_called_once_with ( 'policy_id' ) #NEWLINE# service . update_policy . assert_called_once_with ( 'policy_id' , ** params ) #NEWLINE# mock_show ( service , policy_id = policy . id )