Files
ewoooc/tests/test_shell_active_page_contract.py
OoO b361ca7723
All checks were successful
CD Pipeline / deploy (push) Successful in 1m3s
Fix V3 shell active states
2026-05-18 12:18:00 +08:00

30 lines
1.1 KiB
Python

from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
def test_ai_and_system_pages_pass_active_page_to_v3_shell():
ai_routes = (ROOT / "routes/ai_routes.py").read_text(encoding="utf-8")
system_routes = (ROOT / "routes/system_public_routes.py").read_text(encoding="utf-8")
assert "render_template('ai_recommend.html'," in ai_routes
assert "active_page='ai_recommend'" in ai_routes
assert "render_template('ai_history.html', active_page='ai_history')" in ai_routes
assert "render_template('ai_intelligence.html', active_page='ai_intelligence')" in ai_routes
assert "render_template('logs.html', active_page='logs')" in system_routes
def test_ai_and_logs_titles_use_ewoooc_brand():
templates = [
ROOT / "templates/ai_recommend.html",
ROOT / "templates/ai_intelligence.html",
ROOT / "templates/ai_history.html",
ROOT / "templates/logs.html",
]
for template_path in templates:
source = template_path.read_text(encoding="utf-8")
assert "EwoooC" in source
assert "WOOO TECH" not in source