"""The deploy preflight rejects unresolved placeholder tokens and passes resolved pages. Complements tests/test_static_pages.py, which deliberately does not pin tokens (CI is green in both states; deploying with tokens is what must fail, and only here).""" from __future__ import annotations import sys from pathlib import Path sys.path.insert(0, str(Path(__file__).parents[1] / "scripts")) import preflight_deploy # noqa: E402 def test_scan_flags_each_unresolved_token(tmp_path): (tmp_path / "impressum.html").write_text( "
IMPRESSUM_NAME
IMPRESSUM_ADDRESS
IMPRESSUM_CONTACT
\n" ) (tmp_path / "index.html").write_text('book\n') failures = preflight_deploy.scan(tmp_path) assert len(failures) == 4 assert any("impressum.html:1: unresolved IMPRESSUM_NAME" in f for f in failures) assert any("index.html:1: unresolved BOOKING_URL" in f for f in failures) def test_scan_passes_resolved_pages(tmp_path): (tmp_path / "impressum.html").write_text("Real Name
Real Street 1