Skip to content

Commit 5e94feb

Browse files
committed
don't use raw _rpc for methods for methods that don't need it
1 parent 10de1f4 commit 5e94feb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

deltachat-rpc-client/tests/test_chatlist_events.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ def test_delivery_status(acfactory: ACFactory) -> None:
6161

6262
event = bob.wait_for_incoming_msg_event()
6363
msg = bob.get_message_by_id(event.msg_id)
64-
bob._rpc.accept_chat(bob.id, msg.get_snapshot().chat_id)
65-
bob.mark_seen_messages([msg])
64+
msg.get_snapshot().chat.accept()
65+
msg.mark_seen()
6666

6767
chat_item = alice._rpc.get_chatlist_items_by_entries(alice.id, [alice_chat_bob.id])[str(alice_chat_bob.id)]
6868
assert chat_item["summaryStatus"] == const.MessageState.OUT_DELIVERED
@@ -123,7 +123,7 @@ def test_download_on_demand(acfactory: ACFactory) -> None:
123123
event = bob.wait_for_incoming_msg_event()
124124
msg = bob.get_message_by_id(event.msg_id)
125125
chat_id = msg.get_snapshot().chat_id
126-
bob._rpc.accept_chat(bob.id, msg.get_snapshot().chat_id)
126+
msg.get_snapshot().chat.accept()
127127
bob.get_chat_by_id(chat_id).send_message(
128128
"Hello World, this message is bigger than 5 bytes",
129129
html=base64.b64encode(os.urandom(300000)).decode("utf-8"),
@@ -174,7 +174,7 @@ def test_imap_sync_seen_msgs(acfactory: ACFactory) -> None:
174174
event = bob.wait_for_incoming_msg_event()
175175
msg = bob.get_message_by_id(event.msg_id)
176176
bob_chat_id = msg.get_snapshot().chat_id
177-
bob._rpc.accept_chat(bob.id, bob_chat_id)
177+
msg.get_snapshot().chat.accept()
178178

179179
alice.clear_all_events()
180180
alice_second_device.clear_all_events()
@@ -186,7 +186,7 @@ def test_imap_sync_seen_msgs(acfactory: ACFactory) -> None:
186186
event = alice.wait_for_incoming_msg_event()
187187
msg = alice.get_message_by_id(event.msg_id)
188188
alice_second_device.clear_all_events()
189-
alice.mark_seen_messages([msg])
189+
msg.mark_seen()
190190

191191
wait_for_chatlist_specific_item(bob, bob_chat_id)
192192
wait_for_chatlist_specific_item(alice, alice_chat_bob.id)

0 commit comments

Comments
 (0)