diff options
Diffstat (limited to 'tests/test_init.py')
| -rw-r--r-- | tests/test_init.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test_init.py b/tests/test_init.py new file mode 100644 index 0000000..d690032 --- /dev/null +++ b/tests/test_init.py @@ -0,0 +1,24 @@ +# SPDX-FileCopyrightText: 2026 Dennis Fink <me+coding@dennisfink.me> +# +# SPDX-License-Identifier: BSD-3-Clause + +"""Test application initialization and its public integrations.""" + +from flask import Flask + +from webmentions_ssg import VERSION, HUEY +from webmentions_ssg.url_security import is_http_url + + +def test_create_app_registers_blueprint_and_extensions(app: Flask) -> None: + assert "root" in app.blueprints + assert app.extensions["huey"] is HUEY + assert app.jinja_env.filters["is_http_url"] is is_http_url + + +def test_create_app_exposes_version_in_templates(app: Flask) -> None: + with app.test_request_context(): + context: dict[str, str] = {} + app.update_template_context(context) + + assert context["VERSION"] == VERSION |
