#NEWLINE# def test_delete_files( self ) : #NEWLINE# #INDENT# self . plan_store . delete_file = mock . MagicMock ( ) #NEWLINE# plan_mgr = plan . PlanManager ( self . plan_store , log_mock . heatclient ) #NEWLINE# plan_mgr . delete_file ( self . plan_name , 'fake-file.yaml' ) #NEWLINE# self . plan_store . delete_file . assert_called_with ( self . plan_name , 'fake-file.yaml' ) #NEWLINE# self . plan_store . delete_file = mock . Mock ( side_effect = exception . FileDoesNotExistError ( name = 'fake-file.yaml' ) ) #NEWLINE# self . assertRaises ( exception . FileDoesNotExistError , plan_mgr . delete_file , self . plan_name , 'fake-file.yaml' ) #NEWLINE# with mock . patch ( 'tripleo_common.core.plan.LOG' ) as log_mock : #NEWLINE# #INDENT# self . plan_store . delete_file = mock . Mock ( side_effect = ValueError ( ) ) #NEWLINE# self . assertRaises ( ValueError , plan_mgr . delete_file , self . plan_name , 'fake-file.yaml' ) #NEWLINE# log_mock . exception . assert_called_with ( 'Error deleting file from plan.' )