From 9949b44560b43da6c4ceee4f7387a61feb3bb2d0 Mon Sep 17 00:00:00 2001 From: Bibo-Joshi Date: Tue, 30 Mar 2021 19:28:01 +0200 Subject: [PATCH] Update Fallback Test-Bots (#2451) --- tests/bots.py | 33 +++++++++++++-------------------- tests/test_bot.py | 2 +- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/tests/bots.py b/tests/bots.py index 514f90285..7d5c4d382 100644 --- a/tests/bots.py +++ b/tests/bots.py @@ -28,26 +28,17 @@ from telegram.error import RetryAfter, TimedOut # Provide some public fallbacks so it's easy for contributors to run tests on their local machine # These bots are only able to talk in our test chats, so they are quite useless for other # purposes than testing. -FALLBACKS = [ - { - 'token': '579694714:AAHRLL5zBVy4Blx2jRFKe1HlfnXCg08WuLY', - 'payment_provider_token': '284685063:TEST:NjQ0NjZlNzI5YjJi', - 'chat_id': '675666224', - 'super_group_id': '-1001310911135', - 'channel_id': '@pythontelegrambottests', - 'bot_name': 'PTB tests fallback 1', - 'bot_username': '@ptb_fallback_1_bot', - }, - { - 'token': '558194066:AAEEylntuKSLXj9odiv3TnX7Z5KY2J3zY3M', - 'payment_provider_token': '284685063:TEST:YjEwODQwMTFmNDcy', - 'chat_id': '675666224', - 'super_group_id': '-1001221216830', - 'channel_id': '@pythontelegrambottests', - 'bot_name': 'PTB tests fallback 2', - 'bot_username': '@ptb_fallback_2_bot', - }, -] +FALLBACKS = ( + 'W3sidG9rZW4iOiAiNTc5Njk0NzE0OkFBRnBLOHc2emtrVXJENHhTZVl3RjNNTzhlLTRHcm1jeTdjIiwgInBheW1lbnRfc' + 'HJvdmlkZXJfdG9rZW4iOiAiMjg0Njg1MDYzOlRFU1Q6TmpRME5qWmxOekk1WWpKaSIsICJjaGF0X2lkIjogIjY3NTY2Nj' + 'IyNCIsICJzdXBlcl9ncm91cF9pZCI6ICItMTAwMTMxMDkxMTEzNSIsICJjaGFubmVsX2lkIjogIkBweXRob250ZWxlZ3J' + 'hbWJvdHRlc3RzIiwgImJvdF9uYW1lIjogIlBUQiB0ZXN0cyBmYWxsYmFjayAxIiwgImJvdF91c2VybmFtZSI6ICJAcHRi' + 'X2ZhbGxiYWNrXzFfYm90In0sIHsidG9rZW4iOiAiNTU4MTk0MDY2OkFBRndEUElGbHpHVWxDYVdIdFRPRVg0UkZyWDh1O' + 'URNcWZvIiwgInBheW1lbnRfcHJvdmlkZXJfdG9rZW4iOiAiMjg0Njg1MDYzOlRFU1Q6WWpFd09EUXdNVEZtTkRjeSIsIC' + 'JjaGF0X2lkIjogIjY3NTY2NjIyNCIsICJzdXBlcl9ncm91cF9pZCI6ICItMTAwMTIyMTIxNjgzMCIsICJjaGFubmVsX2l' + 'kIjogIkBweXRob250ZWxlZ3JhbWJvdHRlc3RzIiwgImJvdF9uYW1lIjogIlBUQiB0ZXN0cyBmYWxsYmFjayAyIiwgImJv' + 'dF91c2VybmFtZSI6ICJAcHRiX2ZhbGxiYWNrXzJfYm90In1d' +) GITHUB_ACTION = os.getenv('GITHUB_ACTION', None) BOTS = os.getenv('BOTS', None) @@ -56,6 +47,8 @@ if GITHUB_ACTION is not None and BOTS is not None and JOB_INDEX is not None: BOTS = json.loads(base64.b64decode(BOTS).decode('utf-8')) JOB_INDEX = int(JOB_INDEX) +FALLBACKS = json.loads(base64.b64decode(FALLBACKS).decode('utf-8')) + def get(name, fallback): # If we have TOKEN, PAYMENT_PROVIDER_TOKEN, CHAT_ID, SUPER_GROUP_ID, diff --git a/tests/test_bot.py b/tests/test_bot.py index f0ee0a500..2bf26b13d 100644 --- a/tests/test_bot.py +++ b/tests/test_bot.py @@ -423,7 +423,7 @@ class TestBot: assert new_message.poll.is_closed @flaky(5, 1) - @pytest.mark.timeout(10) + @pytest.mark.timeout(20) def test_send_close_date_default_tz(self, tz_bot, super_group_id): question = 'Is this a test?' answers = ['Yes', 'No', 'Maybe']