Skip to content

Commit

Permalink
refactor: Install & test - CPython 3.7 (ubuntu), codeco (4).
Browse files Browse the repository at this point in the history
  • Loading branch information
Ajnus committed Nov 5, 2024
1 parent 37c8e90 commit de0e831
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 22 deletions.
40 changes: 20 additions & 20 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ def display_recipient_factory(
recipient_details_list: List[Tuple[int, str]]
) -> List[Dict[str, Any]]:
"""
Generate display_recipient field for (DM/group) messages
Generate display_recipient field for (PM/group) messages
"""
return [
{
Expand All @@ -448,7 +448,7 @@ def msg_template_factory(
recipients: Union[str, List[Dict[str, Any]]] = "PTEST",
) -> Message:
"""
Generate message template for all types of messages(stream/DM/group)
Generate message template for all types of messages(stream/PM/group)
"""
# TODO: Separate Message into distinct types for stream and direct messages.
message = Message(
Expand Down Expand Up @@ -500,13 +500,13 @@ def extra_stream_msg_template() -> Message:


@pytest.fixture
def dm_template() -> Message:
def pm_template() -> Message:
recipients = display_recipient_factory([(5179, "Boo Boo"), (5140, "Foo Foo")])
return msg_template_factory(537287, "private", 1520918736, recipients=recipients)


@pytest.fixture
def group_dm_template() -> Message:
def group_pm_template() -> Message:
recipients = display_recipient_factory(
[(5179, "Boo Boo"), (5140, "Foo Foo"), (5180, "Bar Bar")]
)
Expand All @@ -519,12 +519,12 @@ def private_message_fixture(request: Any) -> Message:


@pytest.fixture(
params=["stream_msg_template", "dm_template", "group_dm_template"],
ids=["stream_message", "dm_message", "group_dm_message"],
params=["stream_msg_template", "pm_template", "group_pm_template"],
ids=["stream_message", "pm_message", "group_pm_message"],
)
def message_fixture(request: Any) -> Message:
"""
Acts as a parametrize fixture for stream msg, dms and group_dms.
Acts as a parametrize fixture for stream msg, dms and group_pms.
"""
# `request` currently does not have an exported Pytest type.
# TODO: Use the exported type when it's made available.
Expand All @@ -535,8 +535,8 @@ def message_fixture(request: Any) -> Message:
@pytest.fixture
def messages_successful_response(
stream_msg_template: Message,
dm_template: Message,
group_dm_template: Message,
pm_template: Message,
group_pm_template: Message,
) -> Dict[str, Any]:
"""
A successful response from a /messages API query.
Expand All @@ -546,8 +546,8 @@ def messages_successful_response(
"anchor": 10000000000000000,
"messages": [
stream_msg_template,
dm_template,
group_dm_template,
pm_template,
group_pm_template,
],
"result": "success",
"msg": "",
Expand Down Expand Up @@ -634,10 +634,10 @@ def topics() -> List[str]:
],
ids=[
"stream_mention__stream_wildcard",
"stream+dm_mention__no_wildcard",
"no_mention__stream+dm_wildcard",
"stream+group_mention__dm_wildcard",
"dm_mention__stream+group_wildcard",
"stream+pm_mention__no_wildcard",
"no_mention__stream+pm_wildcard",
"stream+group_mention__pm_wildcard",
"pm_mention__stream+group_wildcard",
"group_mention__all_wildcard",
"all_mention__stream_wildcard",
"stream+group_mention__wildcard",
Expand Down Expand Up @@ -1060,7 +1060,7 @@ def initial_index() -> Index:

@pytest.fixture
def empty_index(
stream_msg_template: Message, dm_template: Message, group_dm_template: Message
stream_msg_template: Message, pm_template: Message, group_pm_template: Message
) -> Index:
return deepcopy(
Index(
Expand All @@ -1079,8 +1079,8 @@ def empty_index(
lambda: {},
{
stream_msg_template["id"]: stream_msg_template,
dm_template["id"]: dm_template,
group_dm_template["id"]: group_dm_template,
pm_template["id"]: pm_template,
group_pm_template["id"]: group_pm_template,
},
),
)
Expand Down Expand Up @@ -1140,7 +1140,7 @@ def index_multiple_topic_msg(
@pytest.fixture
def index_user(empty_index: Index) -> Index:
"""
Expected index of initial_data when model.narrow = [['dm_with',
Expected index of initial_data when model.narrow = [['pm_with',
'[email protected]'],
"""
user_ids = frozenset({5179, 5140})
Expand All @@ -1153,7 +1153,7 @@ def index_user(empty_index: Index) -> Index:
@pytest.fixture
def index_user_multiple(empty_index: Index) -> Index:
"""
Expected index of initial_data when model.narrow = [['dm_with',
Expected index of initial_data when model.narrow = [['pm_with',
'[email protected], [email protected]'],
"""
user_ids = frozenset({5179, 5140, 5180})
Expand Down
1 change: 0 additions & 1 deletion tests/ui_tools/test_buttons.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
EmojiButton,
MessageLinkButton,
ParsedNarrowLink,
PMButton,
StarredButton,
StreamButton,
TopButton,
Expand Down
1 change: 0 additions & 1 deletion zulipterminal/ui_tools/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
HomeButton,
MentionedButton,
MessageLinkButton,
PMButton,
StarredButton,
StreamButton,
TopicButton,
Expand Down

0 comments on commit de0e831

Please sign in to comment.