mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-12-22 22:45:09 +01:00
Fix weird import in phototest
This commit is contained in:
parent
4b53ed1c65
commit
512ca2643f
1 changed files with 2 additions and 3 deletions
|
@ -127,16 +127,15 @@ class PhotoTest(BaseTest, unittest.TestCase):
|
|||
@flaky(3, 1)
|
||||
@timeout(10)
|
||||
def test_send_photo_bytesio_jpg_file(self):
|
||||
from telegram.inputfile import InputFile
|
||||
# raw image bytes
|
||||
raw_bytes = BytesIO(open(self.photo_bytes_jpg_no_standard, 'rb').read())
|
||||
inputfile = InputFile({"photo": raw_bytes})
|
||||
inputfile = telegram.InputFile({"photo": raw_bytes})
|
||||
self.assertEqual(inputfile.mimetype, 'application/octet-stream')
|
||||
|
||||
# raw image bytes with name info
|
||||
raw_bytes = BytesIO(open(self.photo_bytes_jpg_no_standard, 'rb').read())
|
||||
raw_bytes.name = self.photo_bytes_jpg_no_standard
|
||||
inputfile = InputFile({"photo": raw_bytes})
|
||||
inputfile = telegram.InputFile({"photo": raw_bytes})
|
||||
self.assertEqual(inputfile.mimetype, 'image/jpeg')
|
||||
|
||||
# send raw photo
|
||||
|
|
Loading…
Reference in a new issue