from pathlib import Path ROOT = Path(__file__).resolve().parents[1] APP = (ROOT / "app" / "web_app_fastapi.py").read_text(encoding="utf-8") TEMPLATE = (ROOT / "app" / "templates" / "admin_tools.html").read_text(encoding="utf-8") COMPOSE = (ROOT / "docker-compose.yml").read_text(encoding="utf-8") def test_legacy_checklist_upload_ui_and_route_are_removed(): assert "admin_checklists_upload" not in APP assert "admin_checklists_upload" not in TEMPLATE assert "Cập nhật Checklist & Rule Config" not in TEMPLATE def test_registry_is_the_single_checklist_rule_management_flow(): assert "registry_upload_version_v2" in APP assert "registry_upload_version_v2" in TEMPLATE assert 'name="checklist_file"' in TEMPLATE assert 'name="config_file"' in TEMPLATE assert "registry_activate_v2" in TEMPLATE assert "registry_rollback_v2" in TEMPLATE def test_registry_mount_is_writable_and_persistent(): assert "./registry:/app/registry" in COMPOSE assert "AUDIT_REGISTRY_ROOT=/app/registry" in COMPOSE