mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-03-26 16:38:53 +01:00
Adjust Tests to New Error Messages (#3970)
This commit is contained in:
parent
b1fc0596b9
commit
da3bc6974a
13 changed files with 16 additions and 16 deletions
|
@ -322,7 +322,7 @@ class TestAnimationWithRequest(TestAnimationBase):
|
||||||
)
|
)
|
||||||
assert message.reply_to_message is None
|
assert message.reply_to_message is None
|
||||||
else:
|
else:
|
||||||
with pytest.raises(BadRequest, match="message not found"):
|
with pytest.raises(BadRequest, match="Message to reply not found"):
|
||||||
await default_bot.send_animation(
|
await default_bot.send_animation(
|
||||||
chat_id, animation, reply_to_message_id=reply_to_message.message_id
|
chat_id, animation, reply_to_message_id=reply_to_message.message_id
|
||||||
)
|
)
|
||||||
|
|
|
@ -156,7 +156,7 @@ class TestContactWithRequest(TestContactBase):
|
||||||
)
|
)
|
||||||
assert message.reply_to_message is None
|
assert message.reply_to_message is None
|
||||||
else:
|
else:
|
||||||
with pytest.raises(BadRequest, match="message not found"):
|
with pytest.raises(BadRequest, match="Message to reply not found"):
|
||||||
await default_bot.send_contact(
|
await default_bot.send_contact(
|
||||||
chat_id, contact=contact, reply_to_message_id=reply_to_message.message_id
|
chat_id, contact=contact, reply_to_message_id=reply_to_message.message_id
|
||||||
)
|
)
|
||||||
|
|
|
@ -335,7 +335,7 @@ class TestDocumentWithRequest(TestDocumentBase):
|
||||||
)
|
)
|
||||||
assert message.reply_to_message is None
|
assert message.reply_to_message is None
|
||||||
else:
|
else:
|
||||||
with pytest.raises(BadRequest, match="message not found"):
|
with pytest.raises(BadRequest, match="Message to reply not found"):
|
||||||
await default_bot.send_document(
|
await default_bot.send_document(
|
||||||
chat_id, document, reply_to_message_id=reply_to_message.message_id
|
chat_id, document, reply_to_message_id=reply_to_message.message_id
|
||||||
)
|
)
|
||||||
|
|
|
@ -822,7 +822,7 @@ class TestSendMediaGroupWithRequest:
|
||||||
)
|
)
|
||||||
assert [m.reply_to_message is None for m in messages]
|
assert [m.reply_to_message is None for m in messages]
|
||||||
else:
|
else:
|
||||||
with pytest.raises(BadRequest, match="message not found"):
|
with pytest.raises(BadRequest, match="Message to reply not found"):
|
||||||
await default_bot.send_media_group(
|
await default_bot.send_media_group(
|
||||||
chat_id, media_group, reply_to_message_id=reply_to_message.message_id
|
chat_id, media_group, reply_to_message_id=reply_to_message.message_id
|
||||||
)
|
)
|
||||||
|
|
|
@ -189,7 +189,7 @@ class TestLocationWithRequest:
|
||||||
)
|
)
|
||||||
assert message.reply_to_message is None
|
assert message.reply_to_message is None
|
||||||
else:
|
else:
|
||||||
with pytest.raises(BadRequest, match="message not found"):
|
with pytest.raises(BadRequest, match="Message to reply not found"):
|
||||||
await default_bot.send_location(
|
await default_bot.send_location(
|
||||||
chat_id, location=location, reply_to_message_id=reply_to_message.message_id
|
chat_id, location=location, reply_to_message_id=reply_to_message.message_id
|
||||||
)
|
)
|
||||||
|
|
|
@ -357,7 +357,7 @@ class TestPhotoWithRequest(TestPhotoBase):
|
||||||
)
|
)
|
||||||
assert message.reply_to_message is None
|
assert message.reply_to_message is None
|
||||||
else:
|
else:
|
||||||
with pytest.raises(BadRequest, match="message not found"):
|
with pytest.raises(BadRequest, match="Message to reply not found"):
|
||||||
await default_bot.send_photo(
|
await default_bot.send_photo(
|
||||||
chat_id, photo_file, reply_to_message_id=reply_to_message.message_id
|
chat_id, photo_file, reply_to_message_id=reply_to_message.message_id
|
||||||
)
|
)
|
||||||
|
|
|
@ -399,7 +399,7 @@ class TestStickerWithRequest(TestStickerBase):
|
||||||
)
|
)
|
||||||
assert message.reply_to_message is None
|
assert message.reply_to_message is None
|
||||||
else:
|
else:
|
||||||
with pytest.raises(BadRequest, match="message not found"):
|
with pytest.raises(BadRequest, match="Message to reply not found"):
|
||||||
await default_bot.send_sticker(
|
await default_bot.send_sticker(
|
||||||
chat_id, sticker, reply_to_message_id=reply_to_message.message_id
|
chat_id, sticker, reply_to_message_id=reply_to_message.message_id
|
||||||
)
|
)
|
||||||
|
|
|
@ -171,7 +171,7 @@ class TestVenueWithRequest(TestVenueBase):
|
||||||
)
|
)
|
||||||
assert message.reply_to_message is None
|
assert message.reply_to_message is None
|
||||||
else:
|
else:
|
||||||
with pytest.raises(BadRequest, match="message not found"):
|
with pytest.raises(BadRequest, match="Message to reply not found"):
|
||||||
await default_bot.send_venue(
|
await default_bot.send_venue(
|
||||||
chat_id, venue=venue, reply_to_message_id=reply_to_message.message_id
|
chat_id, venue=venue, reply_to_message_id=reply_to_message.message_id
|
||||||
)
|
)
|
||||||
|
|
|
@ -359,7 +359,7 @@ class TestVideoWithRequest(TestVideoBase):
|
||||||
)
|
)
|
||||||
assert message.reply_to_message is None
|
assert message.reply_to_message is None
|
||||||
else:
|
else:
|
||||||
with pytest.raises(BadRequest, match="message not found"):
|
with pytest.raises(BadRequest, match="Message to reply not found"):
|
||||||
await default_bot.send_video(
|
await default_bot.send_video(
|
||||||
chat_id, video, reply_to_message_id=reply_to_message.message_id
|
chat_id, video, reply_to_message_id=reply_to_message.message_id
|
||||||
)
|
)
|
||||||
|
|
|
@ -258,7 +258,7 @@ class TestVideoNoteWithRequest(TestVideoNoteBase):
|
||||||
)
|
)
|
||||||
assert message.reply_to_message is None
|
assert message.reply_to_message is None
|
||||||
else:
|
else:
|
||||||
with pytest.raises(BadRequest, match="message not found"):
|
with pytest.raises(BadRequest, match="Message to reply not found"):
|
||||||
await default_bot.send_video_note(
|
await default_bot.send_video_note(
|
||||||
chat_id, video_note, reply_to_message_id=reply_to_message.message_id
|
chat_id, video_note, reply_to_message_id=reply_to_message.message_id
|
||||||
)
|
)
|
||||||
|
|
|
@ -308,7 +308,7 @@ class TestVoiceWithRequest(TestVoiceBase):
|
||||||
)
|
)
|
||||||
assert message.reply_to_message is None
|
assert message.reply_to_message is None
|
||||||
else:
|
else:
|
||||||
with pytest.raises(BadRequest, match="message not found"):
|
with pytest.raises(BadRequest, match="Message to reply not found"):
|
||||||
await default_bot.send_voice(
|
await default_bot.send_voice(
|
||||||
chat_id, voice, reply_to_message_id=reply_to_message.message_id
|
chat_id, voice, reply_to_message_id=reply_to_message.message_id
|
||||||
)
|
)
|
||||||
|
|
|
@ -276,7 +276,7 @@ class TestInvoiceWithRequest(TestInvoiceBase):
|
||||||
)
|
)
|
||||||
assert message.reply_to_message is None
|
assert message.reply_to_message is None
|
||||||
else:
|
else:
|
||||||
with pytest.raises(BadRequest, match="message not found"):
|
with pytest.raises(BadRequest, match="Message to reply not found"):
|
||||||
await default_bot.send_invoice(
|
await default_bot.send_invoice(
|
||||||
chat_id,
|
chat_id,
|
||||||
self.title,
|
self.title,
|
||||||
|
|
|
@ -2180,7 +2180,7 @@ class TestBotWithRequest:
|
||||||
)
|
)
|
||||||
assert message.reply_to_message is None
|
assert message.reply_to_message is None
|
||||||
else:
|
else:
|
||||||
with pytest.raises(BadRequest, match="message not found"):
|
with pytest.raises(BadRequest, match="Message to reply not found"):
|
||||||
await default_bot.send_poll(
|
await default_bot.send_poll(
|
||||||
chat_id,
|
chat_id,
|
||||||
question=question,
|
question=question,
|
||||||
|
@ -2237,7 +2237,7 @@ class TestBotWithRequest:
|
||||||
)
|
)
|
||||||
assert message.reply_to_message is None
|
assert message.reply_to_message is None
|
||||||
else:
|
else:
|
||||||
with pytest.raises(BadRequest, match="message not found"):
|
with pytest.raises(BadRequest, match="Message to reply not found"):
|
||||||
await default_bot.send_dice(
|
await default_bot.send_dice(
|
||||||
chat_id, reply_to_message_id=reply_to_message.message_id
|
chat_id, reply_to_message_id=reply_to_message.message_id
|
||||||
)
|
)
|
||||||
|
@ -2570,7 +2570,7 @@ class TestBotWithRequest:
|
||||||
)
|
)
|
||||||
assert message.reply_to_message is None
|
assert message.reply_to_message is None
|
||||||
else:
|
else:
|
||||||
with pytest.raises(BadRequest, match="message not found"):
|
with pytest.raises(BadRequest, match="Message to reply not found"):
|
||||||
await default_bot.send_game(
|
await default_bot.send_game(
|
||||||
chat_id, game_short_name, reply_to_message_id=reply_to_message.message_id
|
chat_id, game_short_name, reply_to_message_id=reply_to_message.message_id
|
||||||
)
|
)
|
||||||
|
@ -3053,7 +3053,7 @@ class TestBotWithRequest:
|
||||||
)
|
)
|
||||||
assert message.reply_to_message is None
|
assert message.reply_to_message is None
|
||||||
else:
|
else:
|
||||||
with pytest.raises(BadRequest, match="message not found"):
|
with pytest.raises(BadRequest, match="Message to reply not found"):
|
||||||
await default_bot.send_message(
|
await default_bot.send_message(
|
||||||
chat_id, "test", reply_to_message_id=reply_to_message.message_id
|
chat_id, "test", reply_to_message_id=reply_to_message.message_id
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue