From bb0d028750514e231a98d511259625dacc9fd6fa Mon Sep 17 00:00:00 2001 From: eternnoir Date: Wed, 9 Sep 2015 09:43:19 +0800 Subject: [PATCH] Add parse_mode markdown test. --- tests/test_telebot.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/test_telebot.py b/tests/test_telebot.py index 930adcd..572228f 100644 --- a/tests/test_telebot.py +++ b/tests/test_telebot.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- import sys + sys.path.append('../') import time @@ -20,7 +21,6 @@ if not should_skip: @pytest.mark.skipif(should_skip, reason="No environment variables configured") class TestTeleBot: - def test_message_listener(self): msg_list = [] for x in range(100): @@ -68,6 +68,17 @@ class TestTeleBot: time.sleep(1) assert not msg.text == 'got' + def test_send_message_with_markdown(self): + tb = telebot.TeleBot(TOKEN) + markdown = """ + *bold text* + _italic text_ + [text](URL) + """ + ret_msg = tb.send_message(CHAT_ID, markdown, parse_mode="Markdown") + assert ret_msg.message_id + + def test_send_file(self): file_data = open('../examples/detailed_example/kitten.jpg', 'rb') tb = telebot.TeleBot(TOKEN) @@ -178,3 +189,4 @@ class TestTeleBot: def test_not_string(self): i1 = 10 assert not util.is_string(i1) +