mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
fix online configure tests
This commit is contained in:
@@ -576,6 +576,16 @@ class Account(object):
|
||||
config_tracker.wait_finish()
|
||||
lib.dc_context_run(self._dc_context)
|
||||
|
||||
@contextmanager
|
||||
def configure(self):
|
||||
if self.is_configured():
|
||||
return
|
||||
if not self.get_config("addr") or not self.get_config("mail_pw"):
|
||||
raise MissingCredentials("addr or mail_pwd not set in config")
|
||||
with self.temp_plugin(ConfigureTracker()) as config_tracker:
|
||||
lib.dc_configure(self._dc_context)
|
||||
yield config_tracker
|
||||
|
||||
def is_started(self):
|
||||
return self._event_thread.is_alive() and bool(lib.dc_is_running(self._dc_context))
|
||||
|
||||
|
||||
@@ -69,8 +69,11 @@ class ConfigureTracker:
|
||||
""" wait until smtp is configured. """
|
||||
self._imap_finished.wait()
|
||||
|
||||
def wait_progress(self):
|
||||
return self._progress.get()
|
||||
def wait_progress(self, data1=None):
|
||||
while 1:
|
||||
evdata = self._progress.get()
|
||||
if data1 is None or evdata == data1:
|
||||
break
|
||||
|
||||
def wait_finish(self):
|
||||
""" wait until configure is completed.
|
||||
|
||||
Reference in New Issue
Block a user