1
0
Fork 0
mirror of https://github.com/deltachat/deltachat-core.git synced 2025-10-04 02:09:17 +02:00

add Account.get_infostring() to show low-level core info

This commit is contained in:
holger krekel 2018-10-08 16:40:20 +02:00
parent 6ed2b427e4
commit ddc7ef7703
5 changed files with 20 additions and 1 deletions

View file

@ -1,3 +1,9 @@
0.7.1
-----
- add Account.get_infostring() to show low-level info about account state
0.7
---

View file

@ -1,3 +1,6 @@
[devpi:upload]
formats = sdist.tgz
no-vcs = 1
[bdist_wheel]
universal = 1

View file

@ -2,7 +2,7 @@ from deltachat import capi, const
from deltachat.capi import ffi
from deltachat.account import Account # noqa
__version__ = "0.7.0"
__version__ = "0.7.1"
_DC_CALLBACK_MAP = {}

View file

@ -96,6 +96,11 @@ class Account(object):
if not self.is_configured():
raise ValueError("need to configure first")
def get_infostring(self):
""" return info of the configured account. """
self.check_is_configured()
return from_dc_charpointer(lib.dc_get_info(self._dc_context))
def get_self_contact(self):
""" return this account's identity as a :class:`deltachat.chatting.Contact`.

View file

@ -18,6 +18,11 @@ class TestOfflineAccount:
with pytest.raises(ValueError):
ac1.get_self_contact()
def test_get_info(self, acfactory):
ac1 = acfactory.get_configured_offline_account()
out = ac1.get_infostring()
assert "number_of_chats=0" in out
def test_selfcontact_configured(self, acfactory):
ac1 = acfactory.get_configured_offline_account()
me = ac1.get_self_contact()