Exemplo n.º 1
0
 def test_fetch_resource_alarm_status_insufficient(self):
     """Status should display 'Insufficient data' when at least one is insufficient and none are in alarm state"""
     item_id = 'i-123456'
     alarms = [
         self.make_alarm(item_id, state_value='OK'),
         self.make_alarm(item_id, state_value='INSUFFICIENT_DATA'),
     ]
     alarm_status = Alarm.get_resource_alarm_status(item_id, alarms)
     self.assertEqual(alarm_status, 'Insufficient data')
Exemplo n.º 2
0
 def test_fetch_resource_alarm_status_ok(self):
     """Status should display OK if resource has alarms and none are insufficient or in alarm state"""
     item_id = 'i-123456'
     alarms = [
         self.make_alarm(item_id, state_value='OK'),
         self.make_alarm(item_id, state_value='OK')
     ]
     alarm_status = Alarm.get_resource_alarm_status(item_id, alarms)
     self.assertEqual(alarm_status, 'OK')
Exemplo n.º 3
0
 def test_fetch_resource_alarm_status_ok(self):
     """Status should display OK if resource has alarms and none are insufficient or in alarm state"""
     item_id = 'i-123456'
     alarms = [
         self.make_alarm(item_id, state_value='OK'),
         self.make_alarm(item_id, state_value='OK')
     ]
     alarm_status = Alarm.get_resource_alarm_status(item_id, alarms)
     self.assertEqual(alarm_status, 'OK')
Exemplo n.º 4
0
 def test_fetch_resource_alarm_status_insufficient(self):
     """Status should display 'Insufficient data' when at least one is insufficient and none are in alarm state"""
     item_id = 'i-123456'
     alarms = [
         self.make_alarm(item_id, state_value='OK'),
         self.make_alarm(item_id, state_value='INSUFFICIENT_DATA'),
     ]
     alarm_status = Alarm.get_resource_alarm_status(item_id, alarms)
     self.assertEqual(alarm_status, 'Insufficient data')
Exemplo n.º 5
0
 def test_fetch_resource_alarm_status_alarm(self):
     """Status should display 'Alarm' when at least one is in alarm state"""
     item_id = 'i-123456'
     alarms = [
         self.make_alarm(item_id, state_value='OK'),
         self.make_alarm(item_id, state_value='INSUFFICIENT_DATA'),
         self.make_alarm(item_id, state_value='ALARM'),
     ]
     alarm_status = Alarm.get_resource_alarm_status(item_id, alarms)
     self.assertEqual(alarm_status, 'Alarm')
Exemplo n.º 6
0
 def test_fetch_resource_alarm_status_alarm(self):
     """Status should display 'Alarm' when at least one is in alarm state"""
     item_id = 'i-123456'
     alarms = [
         self.make_alarm(item_id, state_value='OK'),
         self.make_alarm(item_id, state_value='INSUFFICIENT_DATA'),
         self.make_alarm(item_id, state_value='ALARM'),
     ]
     alarm_status = Alarm.get_resource_alarm_status(item_id, alarms)
     self.assertEqual(alarm_status, 'Alarm')