From a791ff4e46c2496920863fc5f678f1e4df8352ad Mon Sep 17 00:00:00 2001 From: Vlad Galatskiy Date: Sun, 27 Jun 2021 11:58:33 +0300 Subject: [PATCH] Add tests for file sending with name --- tests/test_telebot.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test_telebot.py b/tests/test_telebot.py index a22adcd..377bd72 100644 --- a/tests/test_telebot.py +++ b/tests/test_telebot.py @@ -126,6 +126,16 @@ class TestTeleBot: ret_msg = tb.send_document(CHAT_ID, ret_msg.document.file_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): file_data = open('../examples/detailed_example/kitten.jpg', 'rb') tb = telebot.TeleBot(TOKEN)