aboutsummaryrefslogtreecommitdiff
path: root/tests/test_init.py
diff options
context:
space:
mode:
authorDennis Fink2026-10-30 11:51:34 +0100
committerDennis Fink2026-10-30 11:51:34 +0100
commit37bc3853dded34e3d1323874927979ce510e4910 (patch)
tree7d6d2181d9bb05f4d4a8d00152c172cc92e7ab63 /tests/test_init.py
parent4485aeb573ceb37237ea1fbc80665ed6c4136116 (diff)
downloadwebmentions-ssg-37bc3853dded34e3d1323874927979ce510e4910.tar.gz
webmentions-ssg-37bc3853dded34e3d1323874927979ce510e4910.zip
test: align test suite with package structure
Diffstat (limited to 'tests/test_init.py')
-rw-r--r--tests/test_init.py24
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