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

Method test_message_handler_reg_fail

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

Source from the content-addressed store, hash-verified

99 assert not msg.text == 'got'
100
101 def test_message_handler_reg_fail(self):
102 bot = telebot.TeleBot(TOKEN)
103 msg = self.create_text_message(r'web.telegram.org/')
104
105 # noinspection PyUnusedLocal
106 @bot.message_handler(regexp=r'((https?):((//)|(\\\\))+([\w\d:#@%/;$()~_?\+-=\\\.&](#!)?)*)')
107 def command_url(message):
108 msg.text = 'got'
109
110 bot.process_new_messages([msg])
111 time.sleep(1)
112 assert not msg.text == 'got'
113
114 def test_send_message_with_markdown(self):
115 tb = 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