Example #1
0
    def test_replace(self):
        """
        It should replace all emojis
        """
        emojis = get_emojis()

        # With no spaces will fail due to fitzpatrick tone being a modifier and also a emoji
        txt = ' '.join(get_emojis_unicode())
        txt_code_points = ' '.join(normalize(e['code_point']) for e in emojis)
        res = replace(txt, lambda emoji: emoji.code_points)
        self.assertEqual(res, txt_code_points)
    def test_replace(self):
        """
        It should replace all emojis
        """
        emojis = get_emojis()

        # With no spaces will fail due to fitzpatrick tone being a modifier and also a emoji
        txt = ' '.join(get_emojis_unicode())
        txt_code_points = ' '.join(normalize(e['code_point']) for e in emojis)
        res = replace(txt, lambda emoji: emoji.code_points)
        self.assertEqual(res, txt_code_points)
 def test_replace_with_no_fitz(self):
     """
     It should replace no-spaced emojis, excluding fitzpatrick tone emojis
     """
     emojis = get_emojis()
     txt = ''.join(e['unicode'] for e in emojis
                   if 'skin-tone' not in e['short_name'])
     txt_code_points = ''.join(
         normalize(e['code_point']) for e in emojis
         if 'skin-tone' not in e['short_name'])
     res = replace(txt, lambda emoji: emoji.code_points)
     self.assertEqual(res, txt_code_points)
Example #4
0
 def test_replace_with_no_fitz(self):
     """
     It should replace no-spaced emojis, excluding fitzpatrick tone emojis
     """
     emojis = get_emojis()
     txt = ''.join(
         e['unicode']
         for e in emojis
         if 'skin-tone' not in e['short_name']
     )
     txt_code_points = ''.join(
         normalize(e['code_point'])
         for e in emojis
         if 'skin-tone' not in e['short_name']
     )
     res = replace(txt, lambda emoji: emoji.code_points)
     self.assertEqual(res, txt_code_points)
Example #5
0
 def test_normalize_separator(self):
     self.assertEqual(normalize('00A9_FE0F_200D_F00', separator='_'), 'a9_f00')
Example #6
0
 def test_normalize_variations(self):
     self.assertEqual(normalize('00A9-FE0F-200D-F00'), 'a9-f00')
Example #7
0
 def test_normalize(self):
     self.assertEqual(normalize('00A900'), 'a900')
 def test_normalize_separator(self):
     self.assertEqual(normalize('00A9_FE0F_200D_F00', separator='_'),
                      'a9_f00')
 def test_normalize_variations(self):
     self.assertEqual(normalize('00A9-FE0F-200D-F00'), 'a9-f00')
 def test_normalize(self):
     self.assertEqual(normalize('00A900'), 'a900')