mirror of
https://github.com/deltachat/deltachat-core.git
synced 2025-10-04 18:29:19 +02:00
a first multi-account test, no real checks yet
This commit is contained in:
parent
b153089d4c
commit
823d1283ac
5 changed files with 76 additions and 21 deletions
|
@ -8,6 +8,13 @@ except ImportError:
|
|||
|
||||
|
||||
class TestLive:
|
||||
|
||||
def test_selfcontact(self, acfactory):
|
||||
ac1 = acfactory.get_live_account(started=False)
|
||||
me = ac1.get_self_contact()
|
||||
assert me.display_name
|
||||
# assert me.addr # xxx why is this empty?
|
||||
|
||||
def test_contacts(self, acfactory):
|
||||
ac1 = acfactory.get_live_account(started=False)
|
||||
contact1 = ac1.create_contact("some1@hello.com", name="some1")
|
||||
|
@ -17,6 +24,12 @@ class TestLive:
|
|||
assert not contact1.is_blocked
|
||||
assert not contact1.is_verified
|
||||
|
||||
def test_chat(self, acfactory):
|
||||
ac1 = acfactory.get_live_account(started=False)
|
||||
contact1 = ac1.create_contact("some1@hello.com", name="some1")
|
||||
chat = ac1.create_chat_by_contact(contact1)
|
||||
assert chat.id
|
||||
|
||||
def test_basic_configure_login_ok(self, acfactory):
|
||||
q = Queue()
|
||||
ac1 = acfactory.get_live_account(logcallback=q.put)
|
||||
|
@ -32,3 +45,13 @@ class TestLive:
|
|||
if re.match("smtp-login.*ok.", data2.lower()):
|
||||
smtp_ok = True
|
||||
assert ac1.get_config("mail_pw")
|
||||
|
||||
def test_send_message(self, acfactory):
|
||||
ac1 = acfactory.get_live_account()
|
||||
ac2 = acfactory.get_live_account()
|
||||
c2 = ac2.get_self_contact()
|
||||
chat = ac1.create_chat_by_contact(c2)
|
||||
import time
|
||||
time.sleep(5)
|
||||
print ("sending test message")
|
||||
chat.send_text_message("msg1")
|
||||
|
|
|
@ -9,3 +9,4 @@ def test_empty_context():
|
|||
|
||||
def test_event_defines():
|
||||
assert capi.lib.DC_EVENT_INFO == 100
|
||||
assert capi.lib.DC_CONTACT_ID_SELF
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue