Files
template-web-backend-python/code/tests/test_welcome.py
idp-template-mirror a7498db8f0
All checks were successful
__APP_NAME__ — build & deploy / ¿Credenciales de build listas? (push) Successful in 1s
__APP_NAME__ — build & deploy / Calidad + build + push (push) Has been skipped
__APP_NAME__ — build & deploy / ¿Cluster del tenant listo? (push) Has been skipped
__APP_NAME__ — build & deploy / Helm upgrade --install (push) Has been skipped
chore(mirror): sync desde templates/web-backend-python (ADR-095)
2026-06-16 22:06:54 -05:00

22 lines
889 B
Python

"""Cubre la ruta raíz `/`: página de bienvenida por defecto del Golden Path."""
from fastapi.testclient import TestClient
def test_root_serves_welcome_page(client: TestClient) -> None:
response = client.get("/")
assert response.status_code == 200
assert "text/html" in response.headers.get("content-type", "")
body = response.text
# Mensaje clave: el desarrollo del tenant reemplaza esta página tras commit+push.
assert "commit" in body and "push" in body
assert "platform" in body.lower()
# En el template (sin renderizar) el placeholder sigue presente.
assert "__APP_NAME__" in body
def test_root_excluded_from_openapi_schema(client: TestClient) -> None:
# La welcome page no debe ensuciar el contrato OpenAPI del dev (include_in_schema=False).
schema = client.get("/openapi.json").json()
assert "/" not in schema.get("paths", {})