Exemple #1
1
def test_decode_invalid_string():
    with assert_raises(ValueError):
        emoji.decode('__---___--Invalid__--__-Name')
Exemple #2
0
def unicodeemoji2text(text):
    out = u''
    for c in text[:]:
        try:
            c = emoji.decode(c)
        except:
            pass
        out = out + c
    return out
Exemple #3
0
def test_decode():
    # No aliases
    for name, u_code in emoji.EMOJI_UNICODE.items():
        assert emoji.decode(u_code, use_aliases=False) == name
Exemple #4
0
Fichier : ext.py Projet : gioext/gm
 def decode_emoji(cls, handler, html):
   return emoji.decode(handler, html)
Exemple #5
0
def test_decode_invalid_string():
    try:
        emoji.decode('__---___--Invalid__--__-Name')
        raise Exception("Above line should have raised a ValueError")
    except ValueError:
        pass
Exemple #6
0
def test_decode():

    for name, u_code in emoji.EMOJI_UNICODE.items():
        assert emoji.decode(u_code, False) == name
Exemple #7
0
# -*- coding: UTF-8 -*-
import emoji

print(emoji.emojize('Water! :water_wave:'))
print(emoji.decode(u'🌊'))  # for Python 2.x
# print(emoji.decode('🌊')) # for Python 3.x
Exemple #8
0
# -*- coding: UTF-8 -*-
import emoji

print(emoji.emojize('Water! :water_wave:'))
print(emoji.decode(u'🌊')) # for Python 2.x
# print(emoji.decode('🌊')) # for Python 3.x