mirror of
https://github.com/deltachat/deltachat-core.git
synced 2025-10-04 10:19:16 +02:00
use the technique @r10s described for getting an offline but configured account
this also resolves a number of XXX
This commit is contained in:
parent
da78552622
commit
366da3e9fa
3 changed files with 36 additions and 23 deletions
|
@ -4,6 +4,7 @@ import re
|
|||
import threading
|
||||
from deltachat import Account
|
||||
from deltachat.types import cached_property
|
||||
from deltachat.capi import lib
|
||||
|
||||
|
||||
def pytest_addoption(parser):
|
||||
|
@ -35,13 +36,26 @@ def acfactory(pytestconfig, tmpdir, request):
|
|||
configlist.append(d)
|
||||
return configlist
|
||||
|
||||
def get_offline_account(self):
|
||||
def get_unconfigured_account(self):
|
||||
self.offline_count += 1
|
||||
tmpdb = tmpdir.join("offlinedb%d" % self.offline_count)
|
||||
ac = Account(tmpdb.strpath, logid="ac{}".format(self.offline_count))
|
||||
ac._evlogger.set_timeout(2)
|
||||
return ac
|
||||
|
||||
def get_configured_offline_account(self):
|
||||
self.offline_count += 1
|
||||
tmpdb = tmpdir.join("offlinedb%d" % self.offline_count)
|
||||
ac = Account(tmpdb.strpath, logid="ac{}".format(self.offline_count))
|
||||
|
||||
# do a pseudo-configured account
|
||||
addr = "addr{}@offline.org".format(self.offline_count)
|
||||
ac.set_config("addr", addr)
|
||||
lib.dc_set_config(ac._dc_context, b"configured_addr", addr.encode("ascii"))
|
||||
lib.dc_set_config_int(ac._dc_context, b"configured", 1);
|
||||
ac._evlogger.set_timeout(2)
|
||||
return ac
|
||||
|
||||
def get_live_account(self, started=True):
|
||||
if not fn:
|
||||
pytest.skip("specify a --liveconfig file to run tests with real accounts")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue