mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-11-22 07:06:26 +01:00
check for py2 and decode
This commit is contained in:
parent
235bb72702
commit
4d8174edc3
1 changed files with 5 additions and 2 deletions
|
@ -23,7 +23,7 @@ import unittest
|
|||
import os
|
||||
|
||||
from flaky import flaky
|
||||
from future.utils import text_to_native_str
|
||||
from future.utils import PY2
|
||||
|
||||
sys.path.append('.')
|
||||
|
||||
|
@ -71,7 +71,10 @@ class StickerTest(BaseTest, unittest.TestCase):
|
|||
self.assertEqual(sticker.width, self.width)
|
||||
self.assertEqual(sticker.height, self.height)
|
||||
self.assertTrue(isinstance(sticker.thumb, telegram.PhotoSize))
|
||||
self.assertEqual(sticker.emoji, text_to_native_str(self.emoji))
|
||||
if PY2:
|
||||
self.assertEqual(sticker.emoji, self.emoji.decode('utf-8'))
|
||||
else:
|
||||
self.assertEqual(sticker.emoji, self.emoji)
|
||||
self.assertEqual(sticker.file_size, self.file_size)
|
||||
|
||||
def test_sticker_de_json(self):
|
||||
|
|
Loading…
Reference in a new issue