Skip to content

Commit

Permalink
test: add test case for reply
Browse files Browse the repository at this point in the history
  • Loading branch information
TendTo committed Feb 13, 2024
1 parent 1c3bc63 commit 0bb8c70
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions tests/integration/test_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,20 @@ async def test_reply_post_cmd(self, telegram: TelegramSimulator, admin_group: Ch
"""Tests the /reply command.
The bot sends a message to the user on behalf of the admin
"""
await telegram.send_message("/reply TEST", chat=admin_group, reply_to_message=pending_post)
await telegram.send_message("/reply TEST Test2", chat=admin_group, reply_to_message=pending_post)
assert telegram.messages[-2].text.startswith("COMUNICAZIONE DEGLI ADMIN SUL TUO ULTIMO POST:\n")
assert telegram.messages[-2].text.endswith("TEST")
assert telegram.messages[-2].text.endswith("TEST Test2")
assert telegram.last_message.text == "L'utente ha ricevuto il messaggio"

async def test_reply_bot_tag_post_cmd(
self, telegram: TelegramSimulator, admin_group: Chat, pending_post: Message
):
"""Tests the /reply command with the bot tag.
The bot sends a message to the user on behalf of the admin
"""
await telegram.send_message("/reply@bot_tag TEST1 Test2", chat=admin_group, reply_to_message=pending_post)
assert telegram.messages[-2].text.startswith("COMUNICAZIONE DEGLI ADMIN SUL TUO ULTIMO POST:\n")
assert telegram.messages[-2].text.endswith("TEST1 Test2")
assert telegram.last_message.text == "L'utente ha ricevuto il messaggio"

async def test_autoreply_list_cmd(self, telegram: TelegramSimulator, admin_group: Chat, pending_post: Message):
Expand Down

0 comments on commit 0bb8c70

Please sign in to comment.