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

refactor event logging to happen inside the account

This commit is contained in:
holger krekel 2018-09-08 12:34:41 +02:00
parent 823d1283ac
commit 1c77187d5a
3 changed files with 59 additions and 45 deletions

View file

@ -1,11 +1,6 @@
from __future__ import print_function
import re
try:
from queue import Queue
except ImportError:
from Queue import Queue
class TestLive:
@ -31,24 +26,21 @@ class TestLive:
assert chat.id
def test_basic_configure_login_ok(self, acfactory):
q = Queue()
ac1 = acfactory.get_live_account(logcallback=q.put)
ac1 = acfactory.get_live_account()
imap_ok = smtp_ok = False
while not imap_ok or not smtp_ok:
evt_name, data1, data2 = q.get(timeout=5.0)
print(evt_name, data1, data2)
if evt_name == "DC_EVENT_ERROR":
assert 0
if evt_name == "DC_EVENT_INFO":
if re.match("imap-login.*ok.", data2.lower()):
imap_ok = True
if re.match("smtp-login.*ok.", data2.lower()):
smtp_ok = True
evt_name, data1, data2 = \
ac1._evlogger.get_matching("DC_EVENT_INFO", timeout=5)
if re.match("imap-login.*ok.", data2.lower()):
imap_ok = True
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()
return
ac1, ev1 = acfactory.get_live_account()
ac2, ev2 = acfactory.get_live_account()
c2 = ac2.get_self_contact()
chat = ac1.create_chat_by_contact(c2)
import time