mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Add all inquery types.
This commit is contained in:
@ -127,3 +127,34 @@ def test_json_chat():
|
||||
assert chat.type == 'group'
|
||||
assert chat.title == 'Test Title'
|
||||
|
||||
def test_InlineQueryResultCachedPhoto():
|
||||
iq = types.InlineQueryResultCachedPhoto('aaa', 'Fileid')
|
||||
json_str = iq.to_json()
|
||||
assert 'aa' in json_str
|
||||
assert 'Fileid' in json_str
|
||||
assert 'caption' not in json_str
|
||||
|
||||
|
||||
def test_InlineQueryResultCachedPhoto_with_title():
|
||||
iq = types.InlineQueryResultCachedPhoto('aaa', 'Fileid', title='Title')
|
||||
json_str = iq.to_json()
|
||||
assert 'aa' in json_str
|
||||
assert 'Fileid' in json_str
|
||||
assert 'Title' in json_str
|
||||
assert 'caption' not in json_str
|
||||
|
||||
def test_InlineQueryResultCachedPhoto_with_markup():
|
||||
markup = types.InlineKeyboardMarkup()
|
||||
markup.add(types.InlineKeyboardButton("Google", url="http://www.google.com"))
|
||||
markup.add(types.InlineKeyboardButton("Yahoo", url="http://www.yahoo.com"))
|
||||
iq = types.InlineQueryResultCachedPhoto('aaa', 'Fileid', title='Title', reply_markup=markup)
|
||||
json_str = iq.to_json()
|
||||
assert 'aa' in json_str
|
||||
assert 'Fileid' in json_str
|
||||
assert 'Title' in json_str
|
||||
assert 'caption' not in json_str
|
||||
assert 'reply_markup' not in json_str
|
||||
|
||||
|
||||
test_InlineQueryResultCachedPhoto_with_markup()
|
||||
|
||||
|
Reference in New Issue
Block a user