feat: Webhooks (Aufgaben 6-10) — webhook.py, worker.py, Flask-App, WhatsApp + Telegram Routes + Tests

This commit is contained in:
hermes
2026-06-22 07:58:25 +00:00
parent 6f7c5eada2
commit 56b02c1c2d
11 changed files with 629 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
"""Tests für Flask-App-Factory."""
import pytest
from flask import Flask
from src.app import create_app
class TestCreateApp:
"""Tests für create_app."""
def test_create_app_gibt_flask_app_zurueck(self) -> None:
"""create_app() gibt Flask-App zurück."""
app = create_app()
assert isinstance(app, Flask)
def test_health_endpoint_ergibt_ok(self) -> None:
"""GET /health → 200, JSON mit 'status': 'ok'."""
app = create_app()
with app.test_client() as client:
response = client.get("/health")
assert response.status_code == 200
data = response.get_json()
assert data["status"] == "ok"
def test_health_endpoint_queue_size_ist_integer(self) -> None:
"""GET /health → queue_size ist Integer."""
app = create_app()
with app.test_client() as client:
response = client.get("/health")
data = response.get_json()
assert isinstance(data["queue_size"], int)