28 lines
985 B
Python
28 lines
985 B
Python
from session_bot.render import build_channel_text
|
|
|
|
|
|
def test_build_channel_text_includes_phrase_and_status() -> None:
|
|
config = {
|
|
"header_html": "<b>header</b>",
|
|
"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 "<b>header</b>" in text
|
|
assert '<a href="https://t.me/example"><b>ASTAT</b></a>' in text
|
|
assert "исполняет роль" in text
|
|
assert "готов к игре" in text
|