1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Add inline keyboard test.

This commit is contained in:
eternnoir
2016-04-14 13:35:18 +08:00
parent 7958264d64
commit a6b0e9598c
2 changed files with 32 additions and 5 deletions

View File

@ -236,6 +236,24 @@ class TestTeleBot:
ret_msg = tb.send_message(CHAT_ID, text, disable_notification=True)
assert ret_msg.message_id
def test_send_message_with_markup(self):
text = 'CI Test Message'
tb = telebot.TeleBot(TOKEN)
markup = types.ReplyKeyboardMarkup()
markup.add(types.KeyboardButton("1"))
markup.add(types.KeyboardButton("2"))
ret_msg = tb.send_message(CHAT_ID, text, disable_notification=True, reply_markup=markup)
assert ret_msg.message_id
def test_send_message_with_inlinemarkup(self):
text = 'CI Test Message'
tb = telebot.TeleBot(TOKEN)
markup = types.InlineKeyboardMarkup()
markup.add(types.InlineKeyboardButton("Google", url="http://www.google.com"))
markup.add(types.InlineKeyboardButton("Yahoo", url="http://www.yahoo.com"))
ret_msg = tb.send_message(CHAT_ID, text, disable_notification=True, reply_markup=markup)
assert ret_msg.message_id
def test_forward_message(self):
text = 'CI forward_message Test Message'
tb = telebot.TeleBot(TOKEN)
@ -309,3 +327,5 @@ class TestTeleBot:
def test_not_string(self):
i1 = 10
assert not util.is_string(i1)