mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Add new method test case.
This commit is contained in:
parent
468a535257
commit
0b9f91c6fb
@ -16,6 +16,7 @@ should_skip = 'TOKEN' and 'CHAT_ID' not in os.environ
|
|||||||
if not should_skip:
|
if not should_skip:
|
||||||
TOKEN = os.environ['TOKEN']
|
TOKEN = os.environ['TOKEN']
|
||||||
CHAT_ID = os.environ['CHAT_ID']
|
CHAT_ID = os.environ['CHAT_ID']
|
||||||
|
GROUP_ID = os.environ['GROUP_ID']
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(should_skip, reason="No environment variables configured")
|
@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)
|
new_msg = tb.edit_message_text('Edit test', chat_id=CHAT_ID, message_id=msg.message_id)
|
||||||
assert new_msg.text == 'Edit test'
|
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):
|
def test_edit_markup(self):
|
||||||
text = 'CI Test Message'
|
text = 'CI Test Message'
|
||||||
tb = telebot.TeleBot(TOKEN)
|
tb = telebot.TeleBot(TOKEN)
|
||||||
|
Loading…
Reference in New Issue
Block a user