From 622fdf7fa3f044338b6be795b1dfa09427cda156 Mon Sep 17 00:00:00 2001 From: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com> Date: Mon, 6 May 2024 22:35:11 +0200 Subject: [PATCH] Adapt Test Suite to Changes in Error Messages (#4238) --- 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 ba35fb700..f14504a75 100644 --- a/tests/_files/test_animation.py +++ b/tests/_files/test_animation.py @@ -351,7 +351,7 @@ class TestAnimationWithRequest(TestAnimationBase): ) 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 4e7b8cc05..12857ddc6 100644 --- a/tests/_files/test_audio.py +++ b/tests/_files/test_audio.py @@ -378,7 +378,7 @@ class TestAudioWithRequest(TestAudioBase): ) 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 539dcfad9..a4793c3fa 100644 --- a/tests/_files/test_contact.py +++ b/tests/_files/test_contact.py @@ -185,7 +185,7 @@ class TestContactWithRequest(TestContactBase): ) 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 a1c63fd0e..5d078fced 100644 --- a/tests/_files/test_document.py +++ b/tests/_files/test_document.py @@ -364,7 +364,7 @@ class TestDocumentWithRequest(TestDocumentBase): ) 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 72d981f7b..6febe12c8 100644 --- a/tests/_files/test_inputmedia.py +++ b/tests/_files/test_inputmedia.py @@ -873,7 +873,7 @@ class TestSendMediaGroupWithRequest: ) 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 44d96ffe5..aec282ccd 100644 --- a/tests/_files/test_location.py +++ b/tests/_files/test_location.py @@ -218,7 +218,7 @@ class TestLocationWithRequest: ) 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 267b41427..d8be6e814 100644 --- a/tests/_files/test_photo.py +++ b/tests/_files/test_photo.py @@ -384,7 +384,7 @@ class TestPhotoWithRequest(TestPhotoBase): ) 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 c40846811..92186e670 100644 --- a/tests/_files/test_sticker.py +++ b/tests/_files/test_sticker.py @@ -457,7 +457,7 @@ class TestStickerWithRequest(TestStickerBase): ) 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 85a950bf8..0cb8f500b 100644 --- a/tests/_files/test_venue.py +++ b/tests/_files/test_venue.py @@ -200,7 +200,7 @@ class TestVenueWithRequest(TestVenueBase): ) 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 59b49c3d9..c7fedbb8c 100644 --- a/tests/_files/test_video.py +++ b/tests/_files/test_video.py @@ -386,7 +386,7 @@ class TestVideoWithRequest(TestVideoBase): ) 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 d9f66ae6e..625e85eba 100644 --- a/tests/_files/test_videonote.py +++ b/tests/_files/test_videonote.py @@ -287,7 +287,7 @@ class TestVideoNoteWithRequest(TestVideoNoteBase): ) 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 cc85e8bda..8060221c7 100644 --- a/tests/_files/test_voice.py +++ b/tests/_files/test_voice.py @@ -335,7 +335,7 @@ class TestVoiceWithRequest(TestVoiceBase): ) 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 bdbc56a04..532fae0a8 100644 --- a/tests/_payment/test_invoice.py +++ b/tests/_payment/test_invoice.py @@ -312,7 +312,7 @@ class TestInvoiceWithRequest(TestInvoiceBase): ) 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 7021867da..34f25e6ce 100644 --- a/tests/test_bot.py +++ b/tests/test_bot.py @@ -2552,7 +2552,7 @@ class TestBotWithRequest: ) 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 @@ class TestBotWithRequest: ) 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 @@ class TestBotWithRequest: ) 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 @@ class TestBotWithRequest: ) 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 )