teleo-infrastructure/tests/test_telegram_native_rendering_source.py
twentyOne2x 5e1d7a5b8c
Some checks are pending
CI / lint-and-test (push) Waiting to run
Render KB claim links in leoclean replies (#68)
Render KB claim links in leoclean replies.

Local evidence:
- 13 focused tests passed.
- py_compile passed for Telegram bot, both leoclean KB bridges, and KB claim routes.
- ruff F,E9 passed for touched files.

GitHub checks were queued at merge time, not failing.
2026-07-09 08:58:02 +02:00

16 lines
503 B
Python

"""Source-level checks for Telegram-native reply rendering."""
from pathlib import Path
REPO_ROOT = Path(__file__).resolve().parents[1]
def test_telegram_renderer_supports_safe_markdown_links() -> None:
text = (REPO_ROOT / "telegram" / "bot.py").read_text()
assert "MARKDOWN_LINK_RE" in text
assert "https?://" in text
assert "_markdown_link_to_telegram_html" in text
assert '<a href="{url}">{label}</a>' in text
assert "MARKDOWN_LINK_RE.sub(r\"\\1 (\\2)\", text)" in text