Skip to content

Commit

Permalink
Add test.
Browse files Browse the repository at this point in the history
  • Loading branch information
eternnoir committed Sep 10, 2015
1 parent c213b77 commit a8fccdb
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/test_telebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import telebot
from telebot import types
from telebot import apihelper
from telebot import util

should_skip = 'TOKEN' and 'CHAT_ID' not in os.environ
Expand Down Expand Up @@ -68,6 +67,17 @@ def command_url(message):
time.sleep(1)
assert msg.text == 'got'

def test_message_handler_lambda_fail(self):
bot = telebot.TeleBot('')
msg = self.create_text_message(r'text')

@bot.message_handler(func=lambda message: r'lambda' in message.text)
def command_url(message):
msg.text = 'got'

bot.process_new_messages([msg])
time.sleep(1)
assert not msg.text == 'got'

def test_message_handler_reg_fail(self):
bot = telebot.TeleBot('')
Expand Down

0 comments on commit a8fccdb

Please sign in to comment.