Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TahirJalilov committed Dec 6, 2021
1 parent 424acc5 commit b3b0dc6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
7 changes: 6 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
emoji
=====

1.6.2
-----
* Improve performance of demojize()
* Added more tests
* Added warning when someone uses any other language than 'en' with use_aliases=True in emojize()

1.6.1
-----
* Allow multiple aliases
Expand All @@ -14,7 +20,6 @@ emoji
* emoji.version(string) method added
* Included 'variant' in the dict of dicts


1.5.0
-----
* Emojis of English version updated to the Emoji Charts v14.0
Expand Down
2 changes: 1 addition & 1 deletion emoji/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
'EMOJI_ALIAS_UNICODE_ENGLISH', 'UNICODE_EMOJI_ALIAS_ENGLISH', 'EMOJI_DATA',
]

__version__ = '1.6.1'
__version__ = '1.6.2'
__author__ = 'Taehoon Kim, Kevin Wurster and Tahir Jalilov'
__email__ = '[email protected]'
# and [email protected], [email protected]
Expand Down
5 changes: 3 additions & 2 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ def test_emojize_invalid_emoji():
string = ':: baby:: :_: : : : : :-: :+:'
assert emoji.emojize(string, False) == string


def test_alias():
# When use_aliases=False aliases should be passed through untouched
assert emoji.emojize(':soccer:', use_aliases=False) == ':soccer:'
Expand Down Expand Up @@ -165,7 +166,7 @@ def test_invalid_alias():
assert emoji.emojize(':tester:', use_aliases=True) == ':tester:'
assert emoji.emojize(':footbal:', use_aliases=True) == ':footbal:'
assert emoji.emojize(':socer:', use_aliases=True) == ':socer:'
emoji.emojize(':socer:', use_aliases=True,
assert emoji.emojize(':socer:', use_aliases=True,
variant="text_type") == ':socer:'


Expand All @@ -192,6 +193,7 @@ def test_alias_wrong_language():
assert emoji.demojize(thailand, use_aliases=False, language="alias") == ':flag_for_Thailand:'
assert emoji.demojize(thailand, use_aliases=True, language="alias") == ':flag_for_Thailand:'


def test_demojize_name_only():
for emj, item in emoji.EMOJI_DATA.items():
if item['status'] != emoji.STATUS['fully_qualified']:
Expand Down Expand Up @@ -284,7 +286,6 @@ def test_long_emoji():
assert emoji.demojize(emoji.demojize(s)) == s



def test_untranslated():
for emj, item in emoji.EMOJI_DATA.items():
if item['status'] != emoji.STATUS['fully_qualified']:
Expand Down
3 changes: 3 additions & 0 deletions tests/test_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import emoji

_all_languages = None


def all_languages():
"""List of all language keys in EMOJI_DATA"""

Expand Down Expand Up @@ -48,6 +50,7 @@ def check_duplicate_names(lang):
assert name not in seen
seen[name] = 0


def test_duplicate_names():
"""Check that there are no duplicate names in the fully_qualified except for differnt variants"""
for lang in all_languages():
Expand Down

0 comments on commit b3b0dc6

Please sign in to comment.