1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Add tests for file sending with name

This commit is contained in:
Vlad Galatskiy 2021-06-27 11:58:33 +03:00 committed by GitHub
parent e56f134a7c
commit a791ff4e46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -126,6 +126,16 @@ class TestTeleBot:
ret_msg = tb.send_document(CHAT_ID, ret_msg.document.file_id) ret_msg = tb.send_document(CHAT_ID, ret_msg.document.file_id)
assert ret_msg.message_id assert ret_msg.message_id
def test_send_file_with_filename(self):
file_data = open('../examples/detailed_example/kitten.jpg', 'rb')
tb = telebot.TeleBot(TOKEN)
ret_msg = tb.send_document(CHAT_ID, file_data)
assert ret_msg.message_id
ret_msg = tb.send_document(CHAT_ID, file_data, file_name="test.jpg")
assert ret_msg.message_id
def test_send_file_dis_noti(self): def test_send_file_dis_noti(self):
file_data = open('../examples/detailed_example/kitten.jpg', 'rb') file_data = open('../examples/detailed_example/kitten.jpg', 'rb')
tb = telebot.TeleBot(TOKEN) tb = telebot.TeleBot(TOKEN)