ceilometer API test for Alarms

asked 2015-08-12 05:57:56 -0600

chitranshi-shubham gravatar image


I am trying to add the alarm functionality to the ceilometerclient wrapper in horizon. here . I have added the method to get alarm list, now I am trying to write a test case for it here

my test method looks like this.

def test_alarm_list(self):
    alarms = self.alarms.list()
    ceilometerclient = self.stub_ceilometerclient()
    ceilometerclient.alarms = self.mox.CreateMockAnything()
    ret_list = api.ceilometer.alarm_list(self.request,q=[])
    for c in ret_list:
        # assert condition for alarm check

I get an error saying AttributeError: 'CeilometerApiTests' object has no attribute 'alarms' I can see the similar test cases for samples and meters in CeilometerApiTests, so my question is

  1. where should I add the alarms parameter ?
  2. what went wrong here ?
edit retag flag offensive close merge delete