MCPcopy Create free account
hub / github.com/chatmail/core / _getaccount

Method _getaccount

python/src/deltachat/testplugin.py:448–460  ·  view source on GitHub ↗
(self, try_cache_addr=None, closed=False)

Source from the content-addressed store, hash-verified

446 return self._getaccount(closed=closed)
447
448 def _getaccount(self, try_cache_addr=None, closed=False) -> Account:
449 logid = f"ac{len(self._accounts) + 1}"
450 # we need to use fixed database basename for maybe_cache_* functions to work
451 path = self.tmpdir.mkdir(logid).join("dc.db")
452 if try_cache_addr:
453 self.testprocess.cache_maybe_retrieve_configured_db_files(try_cache_addr, path)
454 ac = Account(path.strpath, logging=self._logging, closed=closed)
455 ac._logid = logid # later instantiated FFIEventLogger needs this
456 ac._evtracker = ac.add_account_plugin(FFIEventTracker(ac))
457 if self.pytestconfig.getoption("--debug-setup"):
458 self._acsetup.init_logging(ac)
459 self._accounts.append(ac)
460 return ac
461
462 def set_logging_default(self, logging) -> None:
463 self._logging = bool(logging)

Callers 2

_get_cached_accountMethod · 0.95

Calls 6

add_account_pluginMethod · 0.95
FFIEventTrackerClass · 0.85
init_loggingMethod · 0.80
AccountClass · 0.70
appendMethod · 0.45

Tested by

no test coverage detected