Skip to content

Commit f62e1ff

Browse files
committed
Back out "Adjust test_download_limit_chat_assignment"
This backs out commit b0d8d0f.
1 parent ef5131a commit f62e1ff

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

deltachat-rpc-client/tests/test_something.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,8 @@ def test_download_limit_chat_assignment(acfactory, tmp_path, n_accounts):
593593

594594
alice_group.add_contact(contact)
595595

596+
if n_accounts == 2:
597+
bob_chat_alice = bob.create_chat(alice)
596598
bob.set_config("download_limit", str(download_limit))
597599

598600
alice_group.send_text("hi")
@@ -608,12 +610,15 @@ def test_download_limit_chat_assignment(acfactory, tmp_path, n_accounts):
608610
alice_group.send_file(str(path))
609611
snapshot = bob.get_message_by_id(bob.wait_for_incoming_msg_event().msg_id).get_snapshot()
610612
assert snapshot.download_state == DownloadState.AVAILABLE
611-
612-
# Even with 2 accounts partially downloaded message
613-
# should be correctly assigned to a group
614-
# because it has two contacts (including the sender)
615-
# in the To: field.
616-
assert snapshot.chat == bob_group
613+
if n_accounts > 2:
614+
assert snapshot.chat == bob_group
615+
else:
616+
# Group contains only Alice and Bob,
617+
# so partially downloaded messages are
618+
# hard to distinguish from private replies to group messages.
619+
#
620+
# Message may be a private reply, so we assign it to 1:1 chat with Alice.
621+
assert snapshot.chat == bob_chat_alice
617622

618623

619624
def test_markseen_contact_request(acfactory, tmp_path):

0 commit comments

Comments
 (0)