MCPcopy Create free account
hub / github.com/eternnoir/pyTelegramBotAPI / test_message_handler

Method test_message_handler

tests/test_telebot.py:50–60  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

48 tb.set_update_listener(listener)
49
50 def test_message_handler(self):
51 tb = telebot.TeleBot(TOKEN)
52 msg = self.create_text_message('/help')
53
54 @tb.message_handler(commands=['help', 'start'])
55 def command_handler(message):
56 message.text = 'got'
57
58 tb.process_new_messages([msg])
59 time.sleep(1)
60 assert msg.text == 'got'
61
62 def test_message_handler_reg(self):
63 bot = telebot.TeleBot(TOKEN)

Callers

nothing calls this directly

Calls 2

create_text_messageMethod · 0.95
process_new_messagesMethod · 0.95

Tested by

no test coverage detected