mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-03-16 20:29:55 +01:00
Simplify Unit Tests for Bot.send_chat_action
(#3151)
This commit is contained in:
parent
142e3c0177
commit
1e703a0be5
1 changed files with 3 additions and 16 deletions
|
@ -970,24 +970,11 @@ class TestBot:
|
|||
assert not unprotected_dice.has_protected_content
|
||||
|
||||
@flaky(3, 1)
|
||||
@pytest.mark.parametrize(
|
||||
"chat_action",
|
||||
[
|
||||
ChatAction.FIND_LOCATION,
|
||||
ChatAction.RECORD_VIDEO,
|
||||
ChatAction.RECORD_VIDEO_NOTE,
|
||||
ChatAction.RECORD_VOICE,
|
||||
ChatAction.TYPING,
|
||||
ChatAction.UPLOAD_DOCUMENT,
|
||||
ChatAction.UPLOAD_PHOTO,
|
||||
ChatAction.UPLOAD_VIDEO,
|
||||
ChatAction.UPLOAD_VIDEO_NOTE,
|
||||
ChatAction.UPLOAD_VOICE,
|
||||
ChatAction.CHOOSE_STICKER,
|
||||
],
|
||||
)
|
||||
@pytest.mark.parametrize("chat_action", list(ChatAction))
|
||||
async def test_send_chat_action(self, bot, chat_id, chat_action):
|
||||
assert await bot.send_chat_action(chat_id, chat_action)
|
||||
|
||||
async def test_wrong_chat_action(self, bot, chat_id):
|
||||
with pytest.raises(BadRequest, match="Wrong parameter action"):
|
||||
await bot.send_chat_action(chat_id, "unknown action")
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue