29 lines
1.1 KiB
Python
29 lines
1.1 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",
|
||
"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
|