Mock out ceilometerclient redirect_to_aodh_endpoint

Change-Id: If6280557694c5b651f4a20fef2de732ad1032fb5
Closes-bug: #1483488
This commit is contained in:
Angus Salkeld 2015-08-11 18:56:59 +10:00
parent 457266f4c7
commit de099c733c
2 changed files with 9 additions and 0 deletions

View File

@ -11,6 +11,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from ceilometerclient import client as cc
from keystoneclient import exceptions
from heat.tests import common
from heat.tests import utils
@ -18,6 +21,8 @@ from heat.tests import utils
class CeilometerClientPluginTests(common.HeatTestCase):
def test_create(self):
self.patchobject(cc.AuthPlugin, 'redirect_to_aodh_endpoint',
side_effect=exceptions.EndpointNotFound)
context = utils.dummy_context()
plugin = context.clients.client_plugin('ceilometer')
client = plugin.client()

View File

@ -14,6 +14,8 @@
import datetime
from ceilometerclient import client as cc
from keystoneclient import exceptions
import mox
from oslo_utils import timeutils
@ -635,6 +637,8 @@ class WatchRuleTest(common.HeatTestCase):
stack_id=self.stack_id, rule=rule)
self.wr.store()
self.patchobject(cc.AuthPlugin, 'redirect_to_aodh_endpoint',
side_effect=exceptions.EndpointNotFound)
self.m.StubOutWithMock(self.wr.context.clients.client('ceilometer').
samples, 'create', True)