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

Method test_message_handler_lambda

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

Source from the content-addressed store, hash-verified

73 assert msg.text == 'got'
74
75 def test_message_handler_lambda(self):
76 bot = telebot.TeleBot(TOKEN)
77 msg = self.create_text_message(r'lambda_text')
78
79 # noinspection PyUnusedLocal
80 @bot.message_handler(func=lambda message: r'lambda' in message.text)
81 def command_url(message):
82 msg.text = 'got'
83
84 bot.process_new_messages([msg])
85 time.sleep(1)
86 assert msg.text == 'got'
87
88 def test_message_handler_lambda_fail(self):
89 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