1
0
Fork 0
mirror of https://github.com/deltachat/deltachat-core.git synced 2025-10-04 02:09:17 +02:00

introduce message interface

This commit is contained in:
holger krekel 2018-09-08 18:38:53 +02:00
parent 1d11566ad4
commit 194bd82b8c
3 changed files with 32 additions and 7 deletions

View file

@ -22,7 +22,10 @@ class TestOfflineAccount:
ac1 = acfactory.get_offline_account()
contact1 = ac1.create_contact("some1@hello.com", name="some1")
chat = ac1.create_chat_by_contact(contact1)
assert chat.id
assert chat.id >= lib.DC_CHAT_ID_LAST_SPECIAL, chat.id
chat2 = ac1.create_chat_by_contact(contact1.id)
assert chat2.id == chat.id
class TestOnlineAccount:
@ -62,11 +65,13 @@ class TestOnlineAccount:
self.wait_successful_IMAP_SMTP_connection(ac2)
self.wait_configuration_progress(ac1, 1000)
self.wait_configuration_progress(ac2, 1000)
msgnum = chat.send_text_message("msg1")
msg_id = chat.send_text_message("msg1")
ev = ac1._evlogger.get_matching("DC_EVENT_MSG_DELIVERED")
evt_name, data1, data2 = ev
assert data1 == chat.id
assert data2 == msgnum
assert data2 == msg_id
ev = ac2._evlogger.get_matching("DC_EVENT_MSGS_CHANGED")
assert ev[1] == chat.id
assert ev[2] == msgnum
assert ev[2] == msg_id
msg = ac2.get_message(msg_id)
assert msg.text == "msg1"