(self)
| 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) |
nothing calls this directly
no test coverage detected