Skip to content

Commit

Permalink
refactor: Install & test - CPython 3.7 (ubuntu), codeco (3).
Browse files Browse the repository at this point in the history
  • Loading branch information
Ajnus committed Nov 5, 2024
1 parent 94f4c5b commit f55d757
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1473,7 +1473,7 @@ def classified_unread_counts() -> Dict[str, Any]:
(1000, "Some general unread topic"): 3,
(99, "Some private unread topic"): 1,
},
"unread_dms": {
"unread_pms": {
1: 2,
2: 1,
},
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/test_ui_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,7 @@ def mock_external_classes(self, mocker):
self.thread = mocker.patch(VIEWS + ".threading")
self.super = mocker.patch(VIEWS + ".urwid.Frame.__init__")
self.view.model.unread_counts = { # Minimal, though an UnreadCounts
"unread_dms": {
"unread_pms": {
1: 1,
2: 1,
}
Expand Down
8 changes: 4 additions & 4 deletions zulipterminal/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class UnreadCounts(TypedDict):
all_dms: int
all_mentions: int
unread_topics: Dict[Tuple[int, str], int] # stream_id, topic
unread_dms: Dict[int, int] # sender_id
unread_pms: Dict[int, int] # sender_id
unread_huddles: Dict[FrozenSet[int], int] # Group dms
streams: Dict[int, int] # stream_id

Expand Down Expand Up @@ -209,7 +209,7 @@ def update_unreads(unreads: Dict[KeyT, int], key: KeyT) -> None:
# self-dm has only one display_recipient
# 1-1 dms have 2 display_recipient
elif len(message["display_recipient"]) <= 2:
update_unreads(unread_counts["unread_dms"], message["sender_id"])
update_unreads(unread_counts["unread_pms"], message["sender_id"])
else: # If it's a group dm
update_unreads(
unread_counts["unread_huddles"],
Expand Down Expand Up @@ -490,7 +490,7 @@ def classify_unread_counts(model: Any) -> UnreadCounts:
all_dms=0,
all_mentions=0,
unread_topics=dict(),
unread_dms=dict(),
unread_pms=dict(),
unread_huddles=dict(),
streams=defaultdict(int),
)
Expand All @@ -500,7 +500,7 @@ def classify_unread_counts(model: Any) -> UnreadCounts:

for dm in unread_msg_counts["pms"]:
count = len(dm["unread_message_ids"])
unread_counts["unread_dms"][dm["sender_id"]] = count
unread_counts["unread_pms"][dm["sender_id"]] = count
unread_counts["all_msg"] += count
unread_counts["all_dms"] += count

Expand Down
2 changes: 1 addition & 1 deletion zulipterminal/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ def next_unread_topic_from_message_id(
return None

def get_next_unread_pm(self) -> Optional[int]:
pms = list(self.unread_counts["unread_dms"].keys())
pms = list(self.unread_counts["unread_pms"].keys())
next_pm = False
for pm in pms:
if next_pm is True:
Expand Down

0 comments on commit f55d757

Please sign in to comment.