test_sprite.py 657 B

1234567891011121314151617181920212223
  1. # -*- coding: utf-8; -*-
  2. from __future__ import unicode_literals
  3. from emojipy import Emoji
  4. from unittest import TestCase
  5. class SpriteTest(TestCase):
  6. def setUp(self):
  7. self.emoji = Emoji
  8. self.emoji.sprites = True
  9. self.emoji.image_type = 'png'
  10. self.emoji.unicode_alt = True
  11. def test_unicode_to_image(self):
  12. """
  13. Test 'unicode_to_image' method with 'sprites' enabled
  14. """
  15. text = 'Hello world! 😄 :smile:'
  16. expected = 'Hello world! <span class="emojione emojione-1f604" title=":smile:">😄</span> :smile:'
  17. self.assertEqual(self.emoji.unicode_to_image(text), expected)