"""Unit tests for handler endpoints.""" import json from project_manager import handlers from project_manager.models import persister def test_health_endpoint(test_request_context): """Health endpoint returns ok status.""" response = handlers.health() response_message = json.loads(response.data.decode()) assert response.status_code == 200 assert response_message == {'status': 'ok'} def test_health_db_endpoint(test_request_context, mocker): """Health DB endpoints returns ok status.""" mocker.patch.object(persister, 'check_db_connectivity') response = handlers.health_db() response_message = json.loads(response.data.decode()) assert response.status_code == 200 assert response_message == {'status': 'ok'}