From 16030fbe059462e2c6e425bf8f39d64110dfb5aa Mon Sep 17 00:00:00 2001 From: Scott Wallace Date: Tue, 25 May 2021 10:00:50 +0100 Subject: [PATCH] Add negative healthcheck test --- src/tests/Alertify/test___init__.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/tests/Alertify/test___init__.py b/src/tests/Alertify/test___init__.py index d8294f2..8947073 100644 --- a/src/tests/Alertify/test___init__.py +++ b/src/tests/Alertify/test___init__.py @@ -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), )