check for py2 and decode

This commit is contained in:
Jannes Höke 2016-05-12 08:31:47 +02:00
parent 235bb72702
commit 4d8174edc3

View file

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