Esempio n. 1
0
    def test_should_fail_db_unavailable(self, _):

        db_health = rdc.AlarmsDbHealthCheck()
        db_health.check_db_status = mock.Mock(return_value=(False, 'bar'))
        result = db_health.health_check()

        self.assertFalse(result.healthy)
        self.assertEqual('bar', result.message)
Esempio n. 2
0
    def test_should_pass_db_ok(self, _):

        db_health = rdc.AlarmsDbHealthCheck()
        db_health.check_db_status = mock.Mock(return_value=(True, 'OK'))
        result = db_health.health_check()

        self.assertTrue(result.healthy)
        self.assertEqual('OK', result.message)
Esempio n. 3
0
 def __init__(self):
     super(HealthChecks, self).__init__()
     self._kafka_check = kafka_check.KafkaHealthCheck()
     self._alarm_db_check = alarms_db_check.AlarmsDbHealthCheck()
     self._metrics_db_check = metrics_db_check.MetricsDbCheck()