Skip to content

Commit 8703ae0

Browse files
authored
Merge pull request python-telegram-bot#683 from python-telegram-bot/no_hardcoded_fileids
No hardcoded fileids
2 parents 8fcfdca + cedc38d commit 8703ae0

File tree

13 files changed

+757
-869
lines changed

13 files changed

+757
-869
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ telegram2.mp4
6969
telegram.ogg
7070
telegram.png
7171
telegram.webp
72+
telegram.jpg
7273

7374
# original files from merges
7475
*.orig

tests/bots.py

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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

tests/data/telegram.mp3

92.5 KB
Binary file not shown.

tests/data/telegram.webp

38.6 KB
Loading

0 commit comments

Comments
 (0)