From 0b9f91c6fb53fe0e14cf5f6533b2ab723ec4b9f2 Mon Sep 17 00:00:00 2001 From: eternnoir Date: Tue, 7 Jun 2016 19:16:17 +0800 Subject: [PATCH] Add new method test case. --- tests/test_telebot.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/test_telebot.py b/tests/test_telebot.py index b011989..e294950 100644 --- a/tests/test_telebot.py +++ b/tests/test_telebot.py @@ -16,6 +16,7 @@ should_skip = 'TOKEN' and 'CHAT_ID' not in os.environ if not should_skip: TOKEN = os.environ['TOKEN'] CHAT_ID = os.environ['CHAT_ID'] + GROUP_ID = os.environ['GROUP_ID'] @pytest.mark.skipif(should_skip, reason="No environment variables configured") @@ -351,6 +352,21 @@ class TestTeleBot: new_msg = tb.edit_message_text('Edit test', chat_id=CHAT_ID, message_id=msg.message_id) assert new_msg.text == 'Edit test' + def test_get_chat(self): + tb = telebot.TeleBot(TOKEN) + ch = tb.get_chat(GROUP_ID) + assert ch.id == GROUP_ID + + def test_get_chat_administrators(self): + tb = telebot.TeleBot(TOKEN) + cas = tb.get_chat_administrators(GROUP_ID) + assert len(cas) > 1 + + def test_get_chat_members_count(self): + tb = telebot.TeleBot(TOKEN) + cn = tb.get_chat_members_count(GROUP_ID) + assert cn > 1 + def test_edit_markup(self): text = 'CI Test Message' tb = telebot.TeleBot(TOKEN)