Adjust Tests to New Error Messages (#3970)

This commit is contained in:
Bibo-Joshi 2023-11-11 11:35:23 +01:00 committed by GitHub
parent b1fc0596b9
commit da3bc6974a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 16 additions and 16 deletions

View file

@ -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
) )

View file

@ -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
) )

View file

@ -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
) )

View file

@ -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
) )

View file

@ -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
) )

View file

@ -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
) )

View file

@ -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
) )

View file

@ -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
) )

View file

@ -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
) )

View file

@ -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
) )

View file

@ -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
) )

View file

@ -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,

View file

@ -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
) )