()
| 106 | |
| 107 | |
| 108 | async def test_blueprint_error_handler() -> None: |
| 109 | app = Quart(__name__) |
| 110 | blueprint = Blueprint("blueprint", __name__) |
| 111 | |
| 112 | @blueprint.route("/error/") |
| 113 | async def error() -> ResponseReturnValue: |
| 114 | abort(409) |
| 115 | return "OK" |
| 116 | |
| 117 | @blueprint.errorhandler(409) |
| 118 | async def handler(_: Exception) -> ResponseReturnValue: |
| 119 | return "Something Unique", 409 |
| 120 | |
| 121 | app.register_blueprint(blueprint) |
| 122 | |
| 123 | response = await app.test_client().get("/error/") |
| 124 | assert response.status_code == 409 |
| 125 | assert b"Something Unique" in (await response.get_data()) |
| 126 | |
| 127 | |
| 128 | async def test_blueprint_method_view() -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…