1
0
Fork 0
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:
holger krekel 2018-09-08 17:11:56 +02:00
parent 13d23be7da
commit dead1d1a87
2 changed files with 18 additions and 9 deletions

View file

@ -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: