Conditions | 1 |
Total Lines | 15 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | """ |
||
13 | @patch('byceps.blueprints.monitoring.healthcheck.views._is_rdbms_ok') |
||
14 | def test_healthcheck_fail(is_rdbms_ok_mock, admin_client): |
||
15 | expected_media_type = 'application/health+json' |
||
16 | |||
17 | is_rdbms_ok_mock.return_value = False |
||
18 | |||
19 | response = admin_client.get('/health') |
||
20 | |||
21 | assert response.status_code == 503 |
||
22 | assert response.content_type == expected_media_type |
||
23 | assert response.mimetype == expected_media_type |
||
24 | assert response.get_json() == { |
||
25 | 'status': 'ok', |
||
26 | 'details': { |
||
27 | 'rdbms': [{'status': 'fail'}], |
||
28 | }, |
||
30 |