Change test_post_alarm case in test_alarm_scenarios

It is not reasonable to assert that the new added object
will be the last one when call get_alarms, especially after
default sort direction is added.

Change-Id: Icd81aca5cd15e5ec34f081fe29fbad49dcccc45c
This commit is contained in:
Fengqian Gao 2013-08-09 23:19:54 +08:00
parent de22ede604
commit 9fe6b6eeae

View File

@ -123,7 +123,12 @@ class TestAlarms(FunctionalTest,
headers=self.auth_headers)
alarms = list(self.conn.get_alarms())
self.assertEquals(4, len(alarms))
self.assertEquals(alarms[3].repeat_actions, True)
for alarm in alarms:
if alarm.name == 'added_alarm':
self.assertEqual(alarm.repeat_actions, True)
break
else:
self.fail("Alarm not found")
def test_put_alarm(self):
json = {