From b4b0eb4686128eef47b007cfb61dbc925975662c Mon Sep 17 00:00:00 2001 From: Eldinnie Date: Fri, 23 Jun 2017 20:10:43 +0200 Subject: [PATCH] Tests files from website (#687) Use website for send from url tests instead of github. --- tests/test_audio.py | 4 +++- tests/test_document.py | 2 +- tests/test_photo.py | 2 +- tests/test_sticker.py | 4 +++- tests/test_video.py | 2 +- tests/test_voice.py | 2 +- 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/test_audio.py b/tests/test_audio.py index d09c39746..d4313687d 100644 --- a/tests/test_audio.py +++ b/tests/test_audio.py @@ -36,7 +36,9 @@ class AudioTest(BaseTest, unittest.TestCase): cls.caption = "Test audio" cls.performer = 'Leandro Toledo' cls.title = 'Teste' - cls.audio_file_url = 'https://raw.githubusercontent.com/python-telegram-bot/python-telegram-bot/master/tests/data/telegram.mp3' + # cls.audio_file_url = 'https://python-telegram-bot.org/static/testfiles/telegram.mp3' + # Shortened link, the above one is cached with the wrong duration. + cls.audio_file_url = "https://goo.gl/3En24v" bot_info = get_bot() cls._chat_id = bot_info['chat_id'] diff --git a/tests/test_document.py b/tests/test_document.py index b6ff422bc..f843a71ec 100644 --- a/tests/test_document.py +++ b/tests/test_document.py @@ -33,7 +33,7 @@ class DocumentTest(BaseTest, unittest.TestCase): @classmethod def setUpClass(cls): cls.caption = u'DocumentTest - Caption' - cls.document_file_url = 'https://raw.githubusercontent.com/python-telegram-bot/python-telegram-bot/master/tests/data/telegram.gif' + cls.document_file_url = 'https://python-telegram-bot.org/static/testfiles/telegram.gif' bot_info = get_bot() cls._chat_id = bot_info['chat_id'] diff --git a/tests/test_photo.py b/tests/test_photo.py index 3634cd4cd..b8a07aa46 100644 --- a/tests/test_photo.py +++ b/tests/test_photo.py @@ -35,7 +35,7 @@ class PhotoTest(BaseTest, unittest.TestCase): @classmethod def setUpClass(cls): cls.caption = u'PhotoTest - Caption' - cls.photo_file_url = 'https://raw.githubusercontent.com/python-telegram-bot/python-telegram-bot/master/tests/data/telegram.jpg' + cls.photo_file_url = 'https://python-telegram-bot.org/static/testfiles/telegram.jpg' bot_info = get_bot() cls._chat_id = bot_info['chat_id'] diff --git a/tests/test_sticker.py b/tests/test_sticker.py index 6db9c9c7d..f4c7832f7 100644 --- a/tests/test_sticker.py +++ b/tests/test_sticker.py @@ -35,7 +35,9 @@ class StickerTest(BaseTest, unittest.TestCase): @classmethod def setUpClass(cls): cls.emoji = telegram.Emoji.FLEXED_BICEPS - cls.sticker_file_url = "https://raw.githubusercontent.com/python-telegram-bot/python-telegram-bot/master/tests/data/telegram.webp" # noqa + # cls.sticker_file_url = "https://python-telegram-bot.org/static/testfiles/telegram.webp" + # Serving sticker from gh since our server sends wrong content_type + cls.sticker_file_url = "https://github.com/python-telegram-bot/python-telegram-bot/blob/master/tests/data/telegram.webp?raw=true" # noqa bot_info = get_bot() cls._chat_id = bot_info['chat_id'] diff --git a/tests/test_video.py b/tests/test_video.py index 8de3b3917..2ead24398 100644 --- a/tests/test_video.py +++ b/tests/test_video.py @@ -34,7 +34,7 @@ class VideoTest(BaseTest, unittest.TestCase): @classmethod def setUpClass(cls): cls.caption = u'VideoTest - Caption' - cls.video_file_url = 'https://python-telegram-bot.org/static/website/telegram.mp4' + cls.video_file_url = 'https://python-telegram-bot.org/static/testfiles/telegram.mp4' bot_info = get_bot() cls._chat_id = bot_info['chat_id'] diff --git a/tests/test_voice.py b/tests/test_voice.py index f312cfb6a..b064ff595 100644 --- a/tests/test_voice.py +++ b/tests/test_voice.py @@ -33,7 +33,7 @@ class VoiceTest(BaseTest, unittest.TestCase): @classmethod def setUpClass(cls): - cls.voice_file_url = 'https://raw.githubusercontent.com/python-telegram-bot/python-telegram-bot/master/tests/data/telegram.ogg' + cls.voice_file_url = 'https://python-telegram-bot.org/static/testfiles/telegram.ogg' cls.caption = u"Test voice" voice_file = open('tests/data/telegram.ogg', 'rb')