|
| 1 | +#!/usr/bin/env python |
| 2 | +# |
| 3 | +# A library that provides a Python interface to the Telegram Bot API |
| 4 | +# Copyright (C) 2015-2017 |
| 5 | +# Leandro Toledo de Souza <devs@python-telegram-bot.org> |
| 6 | +# |
| 7 | +# This program is free software: you can redistribute it and/or modify |
| 8 | +# it under the terms of the GNU General Public License as published by |
| 9 | +# the Free Software Foundation, either version 3 of the License, or |
| 10 | +# (at your option) any later version. |
| 11 | +# |
| 12 | +# This program is distributed in the hope that it will be useful, |
| 13 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | +# GNU General Public License for more details. |
| 16 | +# |
| 17 | +# You should have received a copy of the GNU General Public License |
| 18 | +# along with this program. If not, see [http://www.gnu.org/licenses/]. |
| 19 | +"""Provide a bot to tests""" |
| 20 | +import os |
| 21 | + |
| 22 | +import sys |
| 23 | + |
| 24 | + |
| 25 | +bot_settings = { |
| 26 | + 'APPVEYOR': |
| 27 | + { |
| 28 | + 'token': '133505823:AAHZFMHno3mzVLErU5b5jJvaeG--qUyLyG0', |
| 29 | + 'payment_provider_token': '284685063:TEST:ZGJlMmQxZDI3ZTc3' |
| 30 | + }, |
| 31 | + 'TRAVIS': |
| 32 | + { |
| 33 | + 'token': '133505823:AAHZFMHno3mzVLErU5b5jJvaeG--qUyLyG0', |
| 34 | + 'payment_provider_token': '284685063:TEST:ZGJlMmQxZDI3ZTc3' |
| 35 | + }, |
| 36 | + 'FALLBACK': |
| 37 | + { |
| 38 | + 'token': '133505823:AAHZFMHno3mzVLErU5b5jJvaeG--qUyLyG0', |
| 39 | + 'payment_provider_token': '284685063:TEST:ZGJlMmQxZDI3ZTc3' |
| 40 | + } |
| 41 | +} |
| 42 | + |
| 43 | + |
| 44 | +def get_bot(): |
| 45 | + # TODO: Add version info with different bots |
| 46 | + # ver = sys.version_info |
| 47 | + # pyver = "{}{}".format(ver[0], ver[1]) |
| 48 | + # |
| 49 | + bot = None |
| 50 | + if os.environ.get('TRAVIS', False): |
| 51 | + bot = bot_settings.get('TRAVIS', None) |
| 52 | + # TODO: |
| 53 | + # bot = bot_setting.get('TRAVIS'+pyver, None) |
| 54 | + elif os.environ.get('APPVEYOR', False): |
| 55 | + bot = bot_settings.get('APPVEYOR', None) |
| 56 | + # TODO: |
| 57 | + # bot = bot_setting.get('TRAVIS'+pyver, None) |
| 58 | + if not bot: |
| 59 | + bot = bot_settings['FALLBACK'] |
| 60 | + |
| 61 | + bot.update({ |
| 62 | + 'chat_id': '12173560', |
| 63 | + 'group_id': '-49740850', |
| 64 | + 'channel_id': '@pythontelegrambottests' |
| 65 | + }) |
| 66 | + return bot |
0 commit comments