mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-03-15 03:58:35 +01:00
Fixing BufferedReader test #248
This commit is contained in:
parent
9b1a55f9e9
commit
37e48b4707
1 changed files with 3 additions and 1 deletions
|
@ -20,6 +20,7 @@
|
|||
|
||||
"""This module contains a object that represents Tests for Telegram Bot"""
|
||||
|
||||
import io
|
||||
import os
|
||||
from datetime import datetime
|
||||
import sys
|
||||
|
@ -156,7 +157,8 @@ class BotTest(BaseTest, unittest.TestCase):
|
|||
@timeout(10)
|
||||
def testSendBufferedReaderPhoto(self):
|
||||
photo = open('tests/data/telegram.png', 'rb')
|
||||
message = self._bot.sendPhoto(photo=photo,
|
||||
br_photo = io.BufferedReader(io.BytesIO(photo.read()))
|
||||
message = self._bot.sendPhoto(photo=br_photo,
|
||||
chat_id=self._chat_id)
|
||||
|
||||
self.assertTrue(self.is_json(message.to_json()))
|
||||
|
|
Loading…
Add table
Reference in a new issue