Пример #1
0
    def test_CloudwatchAlarmClass_status_empty(self):
        test_instance = alarm.CloudwatchAlarm("ctx_node",
                                              resource_id='alarm_id',
                                              client=self.fake_client,
                                              logger=None)

        self.assertEqual(test_instance.status, None)
Пример #2
0
    def test_CloudwatchAlarmClass_properties_empty(self):
        test_instance = alarm.CloudwatchAlarm("ctx_node",
                                              resource_id='alarm_id',
                                              client=self.fake_client,
                                              logger=None)

        self.assertEqual(test_instance.properties, None)

        self.fake_client.describe_alarms.assert_called_with(
            AlarmNames=['alarm_id'])
Пример #3
0
    def test_CloudwatchAlarmClass_status(self):
        self.fake_client.describe_alarms = MagicMock(
            return_value={'MetricAlarms': ['FirstAlarm']})

        test_instance = alarm.CloudwatchAlarm("ctx_node",
                                              resource_id='alarm_id',
                                              client=self.fake_client,
                                              logger=None)

        self.assertEqual(test_instance.status, None)
Пример #4
0
    def test_CloudwatchAlarmClass_properties(self):
        self.fake_client.describe_alarms = MagicMock(
            return_value={'MetricAlarms': ['FirstAlarm']})

        test_instance = alarm.CloudwatchAlarm("ctx_node",
                                              resource_id='alarm_id',
                                              client=self.fake_client,
                                              logger=None)

        self.assertEqual(test_instance.properties, 'FirstAlarm')

        self.fake_client.describe_alarms.assert_called_with(
            AlarmNames=['alarm_id'])