test: simplify a bit

This commit is contained in:
Hocuri
2025-09-11 21:39:11 +02:00
parent dfc969e3c0
commit c5b5d8020b

View File

@@ -10,7 +10,7 @@ from unittest.mock import MagicMock
import pytest import pytest
from deltachat_rpc_client import Contact, EventType, Message, SpecialContactId, events from deltachat_rpc_client import Contact, EventType, Message, events
from deltachat_rpc_client.const import DownloadState, MessageState from deltachat_rpc_client.const import DownloadState, MessageState
from deltachat_rpc_client.pytestplugin import E2EE_INFO_MSGS from deltachat_rpc_client.pytestplugin import E2EE_INFO_MSGS
from deltachat_rpc_client.rpc import JsonRpcError from deltachat_rpc_client.rpc import JsonRpcError
@@ -939,13 +939,10 @@ def test_leave_broadcast(acfactory, all_devices_online):
# On Alice's side, SELF is not in the list of contact ids # On Alice's side, SELF is not in the list of contact ids
# because OutBroadcast chats never contain SELF in the list. # because OutBroadcast chats never contain SELF in the list.
# On Bob's side, SELF is not in the list because he left. # On Bob's side, SELF is not in the list because he left.
assert SpecialContactId.SELF not in chat_snapshot.contact_ids
if inviter_side: if inviter_side:
assert len(chat_snapshot.contact_ids) == 0 assert len(chat_snapshot.contact_ids) == 0
else: else:
assert contact.id in chat_snapshot.contact_ids assert chat_snapshot.contact_ids == [contact.id]
assert len(chat_snapshot.contact_ids) == 1
logging.info("===================== Bob leaves the broadcast =====================") logging.info("===================== Bob leaves the broadcast =====================")
bob_chat = get_broadcast(bob) bob_chat = get_broadcast(bob)