From ca05e6229e5202e0827a7abbb0db62eb82ea633b Mon Sep 17 00:00:00 2001 From: Harshil <37377066+harshil21@users.noreply.github.com> Date: Sun, 16 Jan 2022 15:35:03 +0530 Subject: [PATCH 1/2] fix failing animation tests --- tests/test_animation.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/test_animation.py b/tests/test_animation.py index b2bd915bc1b..b9bf62c62ff 100644 --- a/tests/test_animation.py +++ b/tests/test_animation.py @@ -58,9 +58,9 @@ class TestAnimation: # animation_file_url = 'https://python-telegram-bot.org/static/testfiles/game.gif' # Shortened link, the above one is cached with the wrong duration. animation_file_url = 'http://bit.ly/2L18jua' - file_name = 'game.gif.mp4' + file_name = 'game.gif.webm' mime_type = 'video/mp4' - file_size = 4127 + file_size = 5859 caption = "Test *animation*" def test_slot_behaviour(self, animation, mro_slots): @@ -145,9 +145,11 @@ def test_send_animation_url_file(self, bot, chat_id, animation): assert message.animation.file_unique_id != '' assert message.animation.duration == animation.duration - assert message.animation.file_name == animation.file_name + assert message.animation.file_name.startswith( + 'game.gif' + ) == animation.file_name.startswith('game.gif') assert message.animation.mime_type == animation.mime_type - assert message.animation.file_size == animation.file_size + assert message.animation.file_size == 4127 and animation.file_size == 5859 @flaky(3, 1) def test_send_animation_caption_entities(self, bot, chat_id, animation): From de6152750bf843daeeaded94157f25880b6d1451 Mon Sep 17 00:00:00 2001 From: Harshil <37377066+harshil21@users.noreply.github.com> Date: Sun, 16 Jan 2022 16:21:05 +0530 Subject: [PATCH 2/2] Update test_animation.py --- tests/test_animation.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_animation.py b/tests/test_animation.py index b9bf62c62ff..3f7c6c85149 100644 --- a/tests/test_animation.py +++ b/tests/test_animation.py @@ -149,7 +149,6 @@ def test_send_animation_url_file(self, bot, chat_id, animation): 'game.gif' ) == animation.file_name.startswith('game.gif') assert message.animation.mime_type == animation.mime_type - assert message.animation.file_size == 4127 and animation.file_size == 5859 @flaky(3, 1) def test_send_animation_caption_entities(self, bot, chat_id, animation):