Skip to content

Commit fbf6135

Browse files
committed
refactor: Install & test - CPython 3.7 (ubuntu), codeco (4).
1 parent 83e7a32 commit fbf6135

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

tests/conftest.py

+21-21
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ def display_recipient_factory(
425425
recipient_details_list: List[Tuple[int, str]]
426426
) -> List[Dict[str, Any]]:
427427
"""
428-
Generate display_recipient field for (DM/group) messages
428+
Generate display_recipient field for (PM/group) messages
429429
"""
430430
return [
431431
{
@@ -448,7 +448,7 @@ def msg_template_factory(
448448
recipients: Union[str, List[Dict[str, Any]]] = "PTEST",
449449
) -> Message:
450450
"""
451-
Generate message template for all types of messages(stream/DM/group)
451+
Generate message template for all types of messages(stream/PM/group)
452452
"""
453453
# TODO: Separate Message into distinct types for stream and direct messages.
454454
message = Message(
@@ -500,13 +500,13 @@ def extra_stream_msg_template() -> Message:
500500

501501

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

507507

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

520520

521521
@pytest.fixture(
522-
params=["stream_msg_template", "dm_template", "group_dm_template"],
523-
ids=["stream_message", "dm_message", "group_dm_message"],
522+
params=["stream_msg_template", "pm_template", "group_pm_template"],
523+
ids=["stream_message", "pm_message", "group_pm_message"],
524524
)
525525
def message_fixture(request: Any) -> Message:
526526
"""
527-
Acts as a parametrize fixture for stream msg, dms and group_dms.
527+
Acts as a parametrize fixture for stream msg, dms and group_pms.
528528
"""
529529
# `request` currently does not have an exported Pytest type.
530530
# TODO: Use the exported type when it's made available.
@@ -535,8 +535,8 @@ def message_fixture(request: Any) -> Message:
535535
@pytest.fixture
536536
def messages_successful_response(
537537
stream_msg_template: Message,
538-
dm_template: Message,
539-
group_dm_template: Message,
538+
pm_template: Message,
539+
group_pm_template: Message,
540540
) -> Dict[str, Any]:
541541
"""
542542
A successful response from a /messages API query.
@@ -546,8 +546,8 @@ def messages_successful_response(
546546
"anchor": 10000000000000000,
547547
"messages": [
548548
stream_msg_template,
549-
dm_template,
550-
group_dm_template,
549+
pm_template,
550+
group_pm_template,
551551
],
552552
"result": "success",
553553
"msg": "",
@@ -634,10 +634,10 @@ def topics() -> List[str]:
634634
],
635635
ids=[
636636
"stream_mention__stream_wildcard",
637-
"stream+dm_mention__no_wildcard",
638-
"no_mention__stream+dm_wildcard",
639-
"stream+group_mention__dm_wildcard",
640-
"dm_mention__stream+group_wildcard",
637+
"stream+pm_mention__no_wildcard",
638+
"no_mention__stream+pm_wildcard",
639+
"stream+group_mention__pm_wildcard",
640+
"pm_mention__stream+group_wildcard",
641641
"group_mention__all_wildcard",
642642
"all_mention__stream_wildcard",
643643
"stream+group_mention__wildcard",
@@ -1060,7 +1060,7 @@ def initial_index() -> Index:
10601060

10611061
@pytest.fixture
10621062
def empty_index(
1063-
stream_msg_template: Message, dm_template: Message, group_dm_template: Message
1063+
stream_msg_template: Message, pm_template: Message, group_pm_template: Message
10641064
) -> Index:
10651065
return deepcopy(
10661066
Index(
@@ -1079,8 +1079,8 @@ def empty_index(
10791079
lambda: {},
10801080
{
10811081
stream_msg_template["id"]: stream_msg_template,
1082-
dm_template["id"]: dm_template,
1083-
group_dm_template["id"]: group_dm_template,
1082+
pm_template["id"]: pm_template,
1083+
group_pm_template["id"]: group_pm_template,
10841084
},
10851085
),
10861086
)
@@ -1140,7 +1140,7 @@ def index_multiple_topic_msg(
11401140
@pytest.fixture
11411141
def index_user(empty_index: Index) -> Index:
11421142
"""
1143-
Expected index of initial_data when model.narrow = [['dm_with',
1143+
Expected index of initial_data when model.narrow = [['pm_with',
11441144
11451145
"""
11461146
user_ids = frozenset({5179, 5140})
@@ -1153,7 +1153,7 @@ def index_user(empty_index: Index) -> Index:
11531153
@pytest.fixture
11541154
def index_user_multiple(empty_index: Index) -> Index:
11551155
"""
1156-
Expected index of initial_data when model.narrow = [['dm_with',
1156+
Expected index of initial_data when model.narrow = [['pm_with',
11571157
11581158
"""
11591159
user_ids = frozenset({5179, 5140, 5180})
@@ -1468,7 +1468,7 @@ def classified_unread_counts() -> Dict[str, Any]:
14681468
"""
14691469
return {
14701470
"all_msg": 12,
1471-
"all_dms": 8,
1471+
"all_pms": 8,
14721472
"unread_topics": {
14731473
(1000, "Some general unread topic"): 3,
14741474
(99, "Some private unread topic"): 1,

0 commit comments

Comments
 (0)