Fixing BufferedReader test #248

This commit is contained in:
leandrotoledo 2016-04-23 09:23:03 -03:00
parent 9b1a55f9e9
commit 37e48b4707

View file

@ -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()))