From 7afa79c47820eb9c3b556eee73f8402d7586efbf Mon Sep 17 00:00:00 2001 From: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com> Date: Mon, 6 May 2024 21:57:36 +0200 Subject: [PATCH] Adapt Test Suite to Changes in Error Messages --- tests/_files/test_animation.py | 2 +- tests/_files/test_audio.py | 2 +- tests/_files/test_contact.py | 2 +- tests/_files/test_document.py | 2 +- tests/_files/test_inputmedia.py | 2 +- tests/_files/test_location.py | 2 +- tests/_files/test_photo.py | 2 +- tests/_files/test_sticker.py | 2 +- tests/_files/test_venue.py | 2 +- tests/_files/test_video.py | 2 +- tests/_files/test_videonote.py | 2 +- tests/_files/test_voice.py | 2 +- tests/_payment/test_invoice.py | 2 +- tests/test_bot.py | 8 ++++---- 14 files changed, 17 insertions(+), 17 deletions(-) diff --git a/tests/_files/test_animation.py b/tests/_files/test_animation.py index ba35fb700eb..f14504a75fd 100644 --- a/tests/_files/test_animation.py +++ b/tests/_files/test_animation.py @@ -351,7 +351,7 @@ async def test_send_animation_default_allow_sending_without_reply( ) assert message.reply_to_message is None else: - with pytest.raises(BadRequest, match="Message to reply not found"): + with pytest.raises(BadRequest, match="Message to be replied not found"): await default_bot.send_animation( chat_id, animation, reply_to_message_id=reply_to_message.message_id ) diff --git a/tests/_files/test_audio.py b/tests/_files/test_audio.py index 4e7b8cc0504..12857ddc6e9 100644 --- a/tests/_files/test_audio.py +++ b/tests/_files/test_audio.py @@ -378,7 +378,7 @@ async def test_send_audio_default_allow_sending_without_reply( ) assert message.reply_to_message is None else: - with pytest.raises(BadRequest, match="Message to reply not found"): + with pytest.raises(BadRequest, match="Message to be replied not found"): await default_bot.send_audio( chat_id, audio, reply_to_message_id=reply_to_message.message_id ) diff --git a/tests/_files/test_contact.py b/tests/_files/test_contact.py index 539dcfad9c6..a4793c3faf5 100644 --- a/tests/_files/test_contact.py +++ b/tests/_files/test_contact.py @@ -185,7 +185,7 @@ async def test_send_contact_default_allow_sending_without_reply( ) assert message.reply_to_message is None else: - with pytest.raises(BadRequest, match="Message to reply not found"): + with pytest.raises(BadRequest, match="Message to be replied not found"): await default_bot.send_contact( chat_id, contact=contact, reply_to_message_id=reply_to_message.message_id ) diff --git a/tests/_files/test_document.py b/tests/_files/test_document.py index a1c63fd0e82..5d078fced20 100644 --- a/tests/_files/test_document.py +++ b/tests/_files/test_document.py @@ -364,7 +364,7 @@ async def test_send_document_default_allow_sending_without_reply( ) assert message.reply_to_message is None else: - with pytest.raises(BadRequest, match="Message to reply not found"): + with pytest.raises(BadRequest, match="Message to be replied not found"): await default_bot.send_document( chat_id, document, reply_to_message_id=reply_to_message.message_id ) diff --git a/tests/_files/test_inputmedia.py b/tests/_files/test_inputmedia.py index 72d981f7bf2..6febe12c87f 100644 --- a/tests/_files/test_inputmedia.py +++ b/tests/_files/test_inputmedia.py @@ -873,7 +873,7 @@ async def test_send_media_group_default_allow_sending_without_reply( ) assert [m.reply_to_message is None for m in messages] else: - with pytest.raises(BadRequest, match="Message to reply not found"): + with pytest.raises(BadRequest, match="Message to be replied not found"): await default_bot.send_media_group( chat_id, media_group, reply_to_message_id=reply_to_message.message_id ) diff --git a/tests/_files/test_location.py b/tests/_files/test_location.py index 44d96ffe57f..aec282ccdcd 100644 --- a/tests/_files/test_location.py +++ b/tests/_files/test_location.py @@ -218,7 +218,7 @@ async def test_send_location_default_allow_sending_without_reply( ) assert message.reply_to_message is None else: - with pytest.raises(BadRequest, match="Message to reply not found"): + with pytest.raises(BadRequest, match="Message to be replied not found"): await default_bot.send_location( chat_id, location=location, reply_to_message_id=reply_to_message.message_id ) diff --git a/tests/_files/test_photo.py b/tests/_files/test_photo.py index 267b414274b..d8be6e81473 100644 --- a/tests/_files/test_photo.py +++ b/tests/_files/test_photo.py @@ -384,7 +384,7 @@ async def test_send_photo_default_allow_sending_without_reply( ) assert message.reply_to_message is None else: - with pytest.raises(BadRequest, match="Message to reply not found"): + with pytest.raises(BadRequest, match="Message to be replied not found"): await default_bot.send_photo( chat_id, photo_file, reply_to_message_id=reply_to_message.message_id ) diff --git a/tests/_files/test_sticker.py b/tests/_files/test_sticker.py index c408468118a..92186e67020 100644 --- a/tests/_files/test_sticker.py +++ b/tests/_files/test_sticker.py @@ -457,7 +457,7 @@ async def test_send_sticker_default_allow_sending_without_reply( ) assert message.reply_to_message is None else: - with pytest.raises(BadRequest, match="Message to reply not found"): + with pytest.raises(BadRequest, match="Message to be replied not found"): await default_bot.send_sticker( chat_id, sticker, reply_to_message_id=reply_to_message.message_id ) diff --git a/tests/_files/test_venue.py b/tests/_files/test_venue.py index 85a950bf81e..0cb8f500b50 100644 --- a/tests/_files/test_venue.py +++ b/tests/_files/test_venue.py @@ -200,7 +200,7 @@ async def test_send_venue_default_allow_sending_without_reply( ) assert message.reply_to_message is None else: - with pytest.raises(BadRequest, match="Message to reply not found"): + with pytest.raises(BadRequest, match="Message to be replied not found"): await default_bot.send_venue( chat_id, venue=venue, reply_to_message_id=reply_to_message.message_id ) diff --git a/tests/_files/test_video.py b/tests/_files/test_video.py index 59b49c3d925..c7fedbb8cf0 100644 --- a/tests/_files/test_video.py +++ b/tests/_files/test_video.py @@ -386,7 +386,7 @@ async def test_send_video_default_allow_sending_without_reply( ) assert message.reply_to_message is None else: - with pytest.raises(BadRequest, match="Message to reply not found"): + with pytest.raises(BadRequest, match="Message to be replied not found"): await default_bot.send_video( chat_id, video, reply_to_message_id=reply_to_message.message_id ) diff --git a/tests/_files/test_videonote.py b/tests/_files/test_videonote.py index d9f66ae6e25..625e85eba87 100644 --- a/tests/_files/test_videonote.py +++ b/tests/_files/test_videonote.py @@ -287,7 +287,7 @@ async def test_send_video_note_default_allow_sending_without_reply( ) assert message.reply_to_message is None else: - with pytest.raises(BadRequest, match="Message to reply not found"): + with pytest.raises(BadRequest, match="Message to be replied not found"): await default_bot.send_video_note( chat_id, video_note, reply_to_message_id=reply_to_message.message_id ) diff --git a/tests/_files/test_voice.py b/tests/_files/test_voice.py index cc85e8bdab5..8060221c724 100644 --- a/tests/_files/test_voice.py +++ b/tests/_files/test_voice.py @@ -335,7 +335,7 @@ async def test_send_voice_default_allow_sending_without_reply( ) assert message.reply_to_message is None else: - with pytest.raises(BadRequest, match="Message to reply not found"): + with pytest.raises(BadRequest, match="Message to be replied not found"): await default_bot.send_voice( chat_id, voice, reply_to_message_id=reply_to_message.message_id ) diff --git a/tests/_payment/test_invoice.py b/tests/_payment/test_invoice.py index bdbc56a0403..532fae0a89b 100644 --- a/tests/_payment/test_invoice.py +++ b/tests/_payment/test_invoice.py @@ -312,7 +312,7 @@ async def test_send_invoice_default_allow_sending_without_reply( ) assert message.reply_to_message is None else: - with pytest.raises(BadRequest, match="Message to reply not found"): + with pytest.raises(BadRequest, match="Message to be replied not found"): await default_bot.send_invoice( chat_id, self.title, diff --git a/tests/test_bot.py b/tests/test_bot.py index 7021867da64..34f25e6ce39 100644 --- a/tests/test_bot.py +++ b/tests/test_bot.py @@ -2552,7 +2552,7 @@ async def test_send_poll_default_allow_sending_without_reply( ) assert message.reply_to_message is None else: - with pytest.raises(BadRequest, match="Message to reply not found"): + with pytest.raises(BadRequest, match="Message to be replied not found"): await default_bot.send_poll( chat_id, question=question, @@ -2609,7 +2609,7 @@ async def test_send_dice_default_allow_sending_without_reply( ) assert message.reply_to_message is None else: - with pytest.raises(BadRequest, match="Message to reply not found"): + with pytest.raises(BadRequest, match="Message to be replied not found"): await default_bot.send_dice( chat_id, reply_to_message_id=reply_to_message.message_id ) @@ -2999,7 +2999,7 @@ async def test_send_game_default_allow_sending_without_reply( ) assert message.reply_to_message is None else: - with pytest.raises(BadRequest, match="Message to reply not found"): + with pytest.raises(BadRequest, match="Message to be replied not found"): await default_bot.send_game( chat_id, game_short_name, reply_to_message_id=reply_to_message.message_id ) @@ -3595,7 +3595,7 @@ async def test_send_message_default_allow_sending_without_reply( ) assert message.reply_to_message is None else: - with pytest.raises(BadRequest, match="Message to reply not found"): + with pytest.raises(BadRequest, match="Message to be replied not found"): await default_bot.send_message( chat_id, "test", reply_to_message_id=reply_to_message.message_id )