Files
Otkritiebot/tests/test_render.py
Verum d8231c13a4
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
post message
2026-04-02 20:59:04 +07:00

29 lines
1.1 KiB
Python
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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",
"link": "https://t.me/example",
"pronouns": "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 "[](https://example.com/image.png)" in text
assert "[ASTAT](https://t.me/example)" in text
assert "исполняет роль" in text
assert "готов к игре" in text