21
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user