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:
parent
6ed2b427e4
commit
ddc7ef7703
5 changed files with 20 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
0.7.1
|
||||||
|
-----
|
||||||
|
|
||||||
|
- add Account.get_infostring() to show low-level info about account state
|
||||||
|
|
||||||
|
|
||||||
0.7
|
0.7
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
[devpi:upload]
|
[devpi:upload]
|
||||||
formats = sdist.tgz
|
formats = sdist.tgz
|
||||||
no-vcs = 1
|
no-vcs = 1
|
||||||
|
|
||||||
|
[bdist_wheel]
|
||||||
|
universal = 1
|
||||||
|
|
|
@ -2,7 +2,7 @@ from deltachat import capi, const
|
||||||
from deltachat.capi import ffi
|
from deltachat.capi import ffi
|
||||||
from deltachat.account import Account # noqa
|
from deltachat.account import Account # noqa
|
||||||
|
|
||||||
__version__ = "0.7.0"
|
__version__ = "0.7.1"
|
||||||
|
|
||||||
|
|
||||||
_DC_CALLBACK_MAP = {}
|
_DC_CALLBACK_MAP = {}
|
||||||
|
|
|
@ -96,6 +96,11 @@ class Account(object):
|
||||||
if not self.is_configured():
|
if not self.is_configured():
|
||||||
raise ValueError("need to configure first")
|
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):
|
def get_self_contact(self):
|
||||||
""" return this account's identity as a :class:`deltachat.chatting.Contact`.
|
""" return this account's identity as a :class:`deltachat.chatting.Contact`.
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,11 @@ class TestOfflineAccount:
|
||||||
with pytest.raises(ValueError):
|
with pytest.raises(ValueError):
|
||||||
ac1.get_self_contact()
|
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):
|
def test_selfcontact_configured(self, acfactory):
|
||||||
ac1 = acfactory.get_configured_offline_account()
|
ac1 = acfactory.get_configured_offline_account()
|
||||||
me = ac1.get_self_contact()
|
me = ac1.get_self_contact()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue