Files
Otkritiebot/tests/test_render.py
Verum 0626454253
Some checks failed
CI / Lint (ruff + mypy) (push) Failing after 32s
CI / Run tests (push) Has been skipped
CI / Docker build test (push) Successful in 10s
423
2026-04-02 21:16:05 +07:00

31 lines
1.2 KiB
Python

from session_bot.render import build_channel_text
def test_build_channel_text_includes_phrase_and_status() -> None:
config = {
"template_text": "{{hidden_link}}\nheader\n\n{{actors}}",
"hidden_link_url": "https://example.com/image.png",
"actors": [
{
"key": "astat",
"display_name": "ASTAT",
"display_html": "<b>ASTAT</b>",
"link": "https://t.me/example",
"pronouns": "he/him",
"meta_html": " he/him ",
"emoji": "🌟",
"default_status": "backstage",
"phrases": {"open": "принимает тейки"},
}
],
"status_labels": {"open": "исполняет роль", "backstage": "в закулисье"},
}
state = {"actors": {"astat": {"status": "open", "phrase": "готов к игре"}}}
text = build_channel_text(config, state)
assert '<a href="https://example.com/image.png">' in text
assert '<a href="https://t.me/example"><b>ASTAT</b></a>' in text
assert "исполняет роль" in text
assert "готов к игре" in text