Skip to content

Commit

Permalink
Add parse_mode markdown test.
Browse files Browse the repository at this point in the history
  • Loading branch information
eternnoir committed Sep 9, 2015
1 parent e7b4e95 commit bb0d028
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/test_telebot.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import sys

sys.path.append('../')

import time
Expand All @@ -20,7 +21,6 @@

@pytest.mark.skipif(should_skip, reason="No environment variables configured")
class TestTeleBot:

def test_message_listener(self):
msg_list = []
for x in range(100):
Expand Down Expand Up @@ -68,6 +68,17 @@ def command_url(message):
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)
Expand Down Expand Up @@ -178,3 +189,4 @@ def test_is_string_string(self):
def test_not_string(self):
i1 = 10
assert not util.is_string(i1)

0 comments on commit bb0d028

Please sign in to comment.