Skip to content

Commit

Permalink
conftest: Migrate emoji fixtures to the new structure of emoji_data.
Browse files Browse the repository at this point in the history
This commit migrates the three emoji fixtures i.e. realm_emoji_data,
unicode_emojis and zulip_emoji to the new format of storing emoji_data
that we recently transitioned to.

This new structure allows emoji_data to also include "aliases" of each
emoji_name (aka canonical_name) that carry the same emoji_code.

Tests amended.
  • Loading branch information
zee-bit committed Jul 19, 2021
1 parent 764e867 commit 299cd6c
Showing 1 changed file with 28 additions and 11 deletions.
39 changes: 28 additions & 11 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,9 @@ def realm_emojis():
def realm_emojis_data():
return OrderedDict(
[
("joker", {"code": "202020", "type": "realm_emoji"}),
("singing", {"code": "3", "type": "realm_emoji"}),
("zulip", {"code": "4", "type": "realm_emoji"}),
("joker", {"code": "202020", "aliases": [], "type": "realm_emoji"}),
("singing", {"code": "3", "aliases": [], "type": "realm_emoji"}),
("zulip", {"code": "4", "aliases": [], "type": "realm_emoji"}),
]
)

Expand All @@ -301,20 +301,37 @@ def realm_emojis_data():
def unicode_emojis():
return OrderedDict(
[
("happy", {"code": "1f600", "type": "unicode_emoji"}),
("joker", {"code": "1f0cf", "type": "unicode_emoji"}),
("joy_cat", {"code": "1f639", "type": "unicode_emoji"}),
("rock_on", {"code": "1f918", "type": "unicode_emoji"}),
("smile", {"code": "263a", "type": "unicode_emoji"}),
("smiley", {"code": "1f603", "type": "unicode_emoji"}),
("smirk", {"code": "1f60f", "type": "unicode_emoji"}),
(
"happy",
{"code": "1f600", "aliases": ["grinning"], "type": "unicode_emoji"},
),
("joker", {"code": "1f0cf", "aliases": [], "type": "unicode_emoji"}),
("joy_cat", {"code": "1f639", "aliases": [], "type": "unicode_emoji"}),
(
"rock_on",
{
"code": "1f918",
"aliases": ["sign_of_the_horns"],
"type": "unicode_emoji",
},
),
("smile", {"code": "263a", "aliases": [], "type": "unicode_emoji"}),
("smiley", {"code": "1f603", "aliases": [], "type": "unicode_emoji"}),
("smirk", {"code": "1f60f", "aliases": ["smug"], "type": "unicode_emoji"}),
]
)


@pytest.fixture
def zulip_emoji():
return OrderedDict([("zulip", {"code": "zulip", "type": "zulip_extra_emoji"})])
return OrderedDict(
[
(
"zulip",
{"code": "zulip", "aliases": [], "type": "zulip_extra_emoji"},
)
]
)


def display_recipient_factory(recipient_details_list: List[Tuple[int, str]]):
Expand Down

0 comments on commit 299cd6c

Please sign in to comment.