31 lines
1.2 KiB
Python
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
|