use debug controller for test raise error api method per jakub suggestion
This commit is contained in:
parent
562cb091dc
commit
2e0cd3339b
|
@ -148,9 +148,9 @@ paths:
|
|||
schema:
|
||||
$ref: "#/components/schemas/OkTrue"
|
||||
|
||||
/status/test-raise-error:
|
||||
/debug/test-raise-error:
|
||||
get:
|
||||
operationId: spiffworkflow_backend.routes.health_controller.test_raise_error
|
||||
operationId: spiffworkflow_backend.routes.debug_controller.test_raise_error
|
||||
summary: Returns an unhandled exception that should notify sentry, if sentry is configured
|
||||
tags:
|
||||
- Status
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
"""APIs for dealing with process groups, process models, and process instances."""
|
||||
from flask.wrappers import Response
|
||||
|
||||
|
||||
def test_raise_error() -> Response:
|
||||
raise Exception("This exception was generated by /debug/test-raise-error for testing purposes. Please ignore.")
|
|
@ -0,0 +1,17 @@
|
|||
from flask.app import Flask
|
||||
from flask.testing import FlaskClient
|
||||
from tests.spiffworkflow_backend.helpers.base_test import BaseTest
|
||||
|
||||
|
||||
class TestDebugController(BaseTest):
|
||||
|
||||
def test_test_raise_error(
|
||||
self,
|
||||
app: Flask,
|
||||
client: FlaskClient,
|
||||
with_db_and_bpmn_file_cleanup: None,
|
||||
) -> None:
|
||||
response = client.get(
|
||||
"/v1.0/debug/test-raise-error",
|
||||
)
|
||||
assert response.status_code == 500
|
|
@ -2,34 +2,15 @@ from flask.app import Flask
|
|||
from flask.testing import FlaskClient
|
||||
from tests.spiffworkflow_backend.helpers.base_test import BaseTest
|
||||
|
||||
from spiffworkflow_backend.models.user import UserModel
|
||||
|
||||
|
||||
class TestHealthController(BaseTest):
|
||||
"""TestUsersController."""
|
||||
|
||||
def test_status(
|
||||
self,
|
||||
app: Flask,
|
||||
client: FlaskClient,
|
||||
with_db_and_bpmn_file_cleanup: None,
|
||||
with_super_admin_user: UserModel,
|
||||
) -> None:
|
||||
"""Test_user_search_returns_a_user."""
|
||||
response = client.get(
|
||||
f"/v1.0/status",
|
||||
"/v1.0/status",
|
||||
)
|
||||
assert response.status_code == 200
|
||||
|
||||
def test_test_raise_error(
|
||||
self,
|
||||
app: Flask,
|
||||
client: FlaskClient,
|
||||
with_db_and_bpmn_file_cleanup: None,
|
||||
with_super_admin_user: UserModel,
|
||||
) -> None:
|
||||
"""Test_user_search_returns_a_user."""
|
||||
response = client.get(
|
||||
f"/v1.0/status/test-raise-error",
|
||||
)
|
||||
assert response.status_code == 500
|
||||
|
|
Loading…
Reference in New Issue