21
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 14s

This commit is contained in:
2026-04-02 21:32:26 +07:00
parent e7bd488551
commit 8fb6da84ae
4 changed files with 160 additions and 86 deletions

View File

@@ -28,3 +28,39 @@ def test_build_channel_text_includes_phrase_and_status() -> None:
assert '<a href="https://t.me/example"><b>ASTAT</b></a>' in text
assert "исполняет роль" in text
assert "готов к игре" in text
def test_build_channel_text_supports_per_actor_placeholders() -> None:
config = {
"template_text": "HEAD\n\n{{actor:astat}}\n\nMID\n\n{{actor:mari}}\n\nTAIL",
"actors": [
{
"key": "astat",
"display_name": "ASTAT",
"display_html": "<b>ASTAT</b>",
"link": "https://t.me/astat",
"pronouns": "he/him",
"meta_html": " he/him ",
"emoji": "🌟",
"default_status": "backstage",
"phrases": {"backstage": "в закулисье."},
},
{
"key": "mari",
"display_name": "MARI",
"display_html": "<b>MARI</b>",
"link": "https://t.me/mari",
"pronouns": "she/her",
"meta_html": " she/her ",
"emoji": "🌟",
"default_status": "open",
"phrases": {"open": "исполняет роль."},
},
],
}
state = {"actors": {}}
text = build_channel_text(config, state)
assert text.count("<b>ASTAT</b>") == 1
assert text.count("<b>MARI</b>") == 1