mirror of
https://github.com/chatmail/core.git
synced 2026-04-05 23:22:11 +03:00
- remove superflous early set_configs to separate config / account making better
- avoid low-level dc_* API access from testplugin
This commit is contained in:
@@ -15,7 +15,6 @@ import pytest
|
||||
import requests
|
||||
|
||||
from . import Account, const
|
||||
from .capi import lib
|
||||
from .events import FFIEventLogger, FFIEventTracker
|
||||
from _pytest._code import Source
|
||||
from deltachat import direct_imap
|
||||
@@ -237,9 +236,6 @@ class ACFactory:
|
||||
path = self.tmpdir.join(logid)
|
||||
ac = Account(path.strpath, logging=self._logging)
|
||||
ac._evtracker = ac.add_account_plugin(FFIEventTracker(ac))
|
||||
ac.addr = ac.get_self_contact().addr
|
||||
ac.set_config("displayname", logid)
|
||||
|
||||
logger = FFIEventLogger(ac)
|
||||
logger.init_time = self.init_time
|
||||
ac.add_account_plugin(logger)
|
||||
@@ -275,13 +271,14 @@ class ACFactory:
|
||||
ac = self.get_unconfigured_account()
|
||||
|
||||
# do a pseudo-configured account
|
||||
addr = "{}@offline.org".format(ac.get_config("displayname"))
|
||||
ac.set_config("addr", addr)
|
||||
acname = os.path.basename(ac.db_path)
|
||||
addr = "{}@offline.org".format(acname)
|
||||
ac.update_config(dict(
|
||||
addr=addr, displayname=acname, mail_pw="123",
|
||||
configured_addr=addr, configured_mail_pw="123",
|
||||
configured="1",
|
||||
))
|
||||
self._preconfigure_key(ac, addr)
|
||||
lib.dc_set_config(ac._dc_context, b"configured_addr", addr.encode("ascii"))
|
||||
ac.set_config("mail_pw", "123")
|
||||
lib.dc_set_config(ac._dc_context, b"configured_mail_pw", b"123")
|
||||
lib.dc_set_config(ac._dc_context, b"configured", b"1")
|
||||
return ac
|
||||
|
||||
def get_online_config(self, quiet=False):
|
||||
@@ -298,6 +295,7 @@ class ACFactory:
|
||||
configdict["smtp_certificate_checks"] = str(const.DC_CERTCK_STRICT)
|
||||
|
||||
ac = self.make_account()
|
||||
configdict["displayname"] = os.path.basename(ac.db_path)
|
||||
self._preconfigure_key(ac, configdict["addr"])
|
||||
return ac, dict(configdict)
|
||||
|
||||
|
||||
@@ -2930,7 +2930,7 @@ class TestGroupStressTests:
|
||||
|
||||
lp.sec("ac2: receiving system message about contact addition")
|
||||
sysmsg = ac2._evtracker.wait_next_incoming_message()
|
||||
assert ac5.addr in sysmsg.text
|
||||
assert ac5.get_config("configured_addr") in sysmsg.text
|
||||
assert sysmsg.chat.num_contacts() == 4
|
||||
|
||||
lp.sec("ac5: waiting for message about addition to the chat")
|
||||
|
||||
Reference in New Issue
Block a user