"""Test Exception Handler.""" from unittest.mock import patch import pytest from images import api from images import handlers # noqa (handlers are imported for test client) @pytest.fixture def fixture_client(): """Create an api test client fixture.""" return api.app.test_client() @patch('images.logic.hello.health_check', side_effect=Exception()) def test_exception_handler(patch_check, fixture_client): """Test an uncaught Exception results in a 500 status code.""" result = fixture_client.get('/hello/') assert result.status_code == 500