mirror of
https://github.com/deltachat/deltachat-core.git
synced 2025-10-04 10:19:16 +02:00
make some tests run also in offline mode and thus on travis
This commit is contained in:
parent
13d23be7da
commit
dead1d1a87
2 changed files with 18 additions and 9 deletions
|
@ -28,13 +28,21 @@ def acfactory(pytestconfig, tmpdir, request):
|
|||
name, value = part.split("=")
|
||||
d[name] = value
|
||||
self.configlist.append(d)
|
||||
self.count = 0
|
||||
self.live_count = 0
|
||||
self.offline_count = 0
|
||||
|
||||
def get_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))
|
||||
ac._evlogger.set_timeout(2)
|
||||
return ac
|
||||
|
||||
def get_live_account(self, started=True):
|
||||
self.live_count += 1
|
||||
configdict = self.configlist.pop(0)
|
||||
tmpdb = tmpdir.join("testdb%d" % self.count)
|
||||
ac = Account(tmpdb.strpath, _logid="ac{}".format(self.count+1))
|
||||
self.count += 1
|
||||
tmpdb = tmpdir.join("livedb%d" % self.live_count)
|
||||
ac = Account(tmpdb.strpath, _logid="ac{}".format(self.live_count))
|
||||
ac._evlogger.set_timeout(10)
|
||||
ac.set_config(**configdict)
|
||||
if started:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue