Skip to content

Commit

Permalink
Adjust test_download_limit_chat_assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
link2xt committed Jan 8, 2025
1 parent 4a41e41 commit 165e283
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions deltachat-rpc-client/tests/test_something.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,8 +593,6 @@ def test_download_limit_chat_assignment(acfactory, tmp_path, n_accounts):

alice_group.add_contact(contact)

if n_accounts == 2:
bob_chat_alice = bob.create_chat(alice)
bob.set_config("download_limit", str(download_limit))

alice_group.send_text("hi")
Expand All @@ -610,15 +608,12 @@ def test_download_limit_chat_assignment(acfactory, tmp_path, n_accounts):
alice_group.send_file(str(path))
snapshot = bob.get_message_by_id(bob.wait_for_incoming_msg_event().msg_id).get_snapshot()
assert snapshot.download_state == DownloadState.AVAILABLE
if n_accounts > 2:
assert snapshot.chat == bob_group
else:
# Group contains only Alice and Bob,
# so partially downloaded messages are
# hard to distinguish from private replies to group messages.
#
# Message may be a private reply, so we assign it to 1:1 chat with Alice.
assert snapshot.chat == bob_chat_alice

# Even with 2 accounts partially downloaded message
# should be correctly assigned to a group
# because it has two contacts (including the sender)
# in the To: field.
assert snapshot.chat == bob_group


def test_markseen_contact_request(acfactory, tmp_path):
Expand Down

0 comments on commit 165e283

Please sign in to comment.