1234567891011121314151617181920212223 |
- # -*- coding: utf-8; -*-
- from __future__ import unicode_literals
- from emojipy import Emoji
- from unittest import TestCase
- class SpriteTest(TestCase):
- def setUp(self):
- self.emoji = Emoji
- self.emoji.sprites = True
- self.emoji.image_type = 'png'
- self.emoji.unicode_alt = True
- def test_unicode_to_image(self):
- """
- Test 'unicode_to_image' method with 'sprites' enabled
- """
- text = 'Hello world! 😄 :smile:'
- expected = 'Hello world! <span class="emojione emojione-1f604" title=":smile:">😄</span> :smile:'
- self.assertEqual(self.emoji.unicode_to_image(text), expected)
|