Skip to content

Commit ffa0ea4

Browse files
committed
Fix test case.
1 parent d53a881 commit ffa0ea4

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎telebot/__init__.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ def send_photo(self, chat_id, photo, caption=None, reply_to_message_id=None, rep
393393
apihelper.send_photo(self.token, chat_id, photo, caption, reply_to_message_id, reply_markup,
394394
disable_notification))
395395

396-
def send_audio(self, chat_id, audio, duration=None, performer=None, title=None, reply_to_message_id=None,
396+
def send_audio(self, chat_id, audio, caption=None, duration=None, performer=None, title=None, reply_to_message_id=None,
397397
reply_markup=None, disable_notification=None, timeout=None):
398398
"""
399399
Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .mp3 format.
@@ -407,10 +407,10 @@ def send_audio(self, chat_id, audio, duration=None, performer=None, title=None,
407407
:return: Message
408408
"""
409409
return types.Message.de_json(
410-
apihelper.send_audio(self.token, chat_id, audio, duration, performer, title, reply_to_message_id,
410+
apihelper.send_audio(self.token, chat_id, audio, caption, duration, performer, title, reply_to_message_id,
411411
reply_markup, disable_notification, timeout))
412412

413-
def send_voice(self, chat_id, voice, duration=None, reply_to_message_id=None, reply_markup=None,
413+
def send_voice(self, chat_id, voice, caption=None, duration=None, reply_to_message_id=None, reply_markup=None,
414414
disable_notification=None, timeout=None):
415415
"""
416416
Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message.
@@ -422,7 +422,7 @@ def send_voice(self, chat_id, voice, duration=None, reply_to_message_id=None, re
422422
:return: Message
423423
"""
424424
return types.Message.de_json(
425-
apihelper.send_voice(self.token, chat_id, voice, duration, reply_to_message_id, reply_markup,
425+
apihelper.send_voice(self.token, chat_id, voice, caption, duration, reply_to_message_id, reply_markup,
426426
disable_notification, timeout))
427427

428428
def send_document(self, chat_id, data, reply_to_message_id=None, caption=None, reply_markup=None,

‎tests/test_telebot.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,15 +193,15 @@ def test_send_photo_dis_noti(self):
193193
def test_send_audio(self):
194194
file_data = open('./test_data/record.mp3', 'rb')
195195
tb = telebot.TeleBot(TOKEN)
196-
ret_msg = tb.send_audio(CHAT_ID, file_data, 1, 'eternnoir', 'pyTelegram')
196+
ret_msg = tb.send_audio(CHAT_ID, file_data, 1, performer='eternnoir', title='pyTelegram')
197197
assert ret_msg.content_type == 'audio'
198198
assert ret_msg.audio.performer == 'eternnoir'
199199
assert ret_msg.audio.title == 'pyTelegram'
200200

201201
def test_send_audio_dis_noti(self):
202202
file_data = open('./test_data/record.mp3', 'rb')
203203
tb = telebot.TeleBot(TOKEN)
204-
ret_msg = tb.send_audio(CHAT_ID, file_data, 1, 'eternnoir', 'pyTelegram', disable_notification=True)
204+
ret_msg = tb.send_audio(CHAT_ID, file_data, 1, performer='eternnoir', title='pyTelegram', disable_notification=True)
205205
assert ret_msg.content_type == 'audio'
206206
assert ret_msg.audio.performer == 'eternnoir'
207207
assert ret_msg.audio.title == 'pyTelegram'

0 commit comments

Comments
 (0)