Add negative healthcheck test

This commit is contained in:
Scott Wallace 2021-05-25 10:00:50 +01:00
parent e47989d80a
commit 16030fbe05

View file

@ -62,7 +62,21 @@ class AlertifyTest(unittest.TestCase):
'json': None,
}
self.assertTupleEqual(
self.assertEqual(
self.alertify.healthcheck(),
('OK', 200),
)
@patch('Alertify.health.Healthcheck.gotify_alive')
def test_bad_healthcheck(self, mock_gotify_alive):
"""Test"""
mock_gotify_alive.return_value = {
'status': 408,
'reason': 'Request Timeout',
'json': None,
}
self.assertNotEqual(
self.alertify.healthcheck(),
('OK', 200),
)