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

Method test_message_handler_reg

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

Source from the content-addressed store, hash-verified

60 assert msg.text == 'got'
61
62 def test_message_handler_reg(self):
63 bot = telebot.TeleBot(TOKEN)
64 msg = self.create_text_message(r'https://web.telegram.org/')
65
66 # noinspection PyUnusedLocal
67 @bot.message_handler(regexp=r'((https?):((//)|(\\\\))+([\w\d:#@%/;$()~_?\+-=\\\.&](#!)?)*)')
68 def command_url(message):
69 msg.text = 'got'
70
71 bot.process_new_messages([msg])
72 time.sleep(1)
73 assert msg.text == 'got'
74
75 def test_message_handler_lambda(self):
76 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