mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
a few streamlinings
This commit is contained in:
@@ -3,8 +3,11 @@ import sys
|
|||||||
from . import capi, const, hookspec
|
from . import capi, const, hookspec
|
||||||
from .capi import ffi
|
from .capi import ffi
|
||||||
from .account import Account # noqa
|
from .account import Account # noqa
|
||||||
from . import eventlogger
|
from .message import Message # noqa
|
||||||
|
from .contact import Contact # noqa
|
||||||
|
from .chat import Chat # noqa
|
||||||
from .hookspec import account_hookimpl, global_hookimpl # noqa
|
from .hookspec import account_hookimpl, global_hookimpl # noqa
|
||||||
|
from . import eventlogger
|
||||||
|
|
||||||
from pkg_resources import get_distribution, DistributionNotFound
|
from pkg_resources import get_distribution, DistributionNotFound
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -214,7 +214,6 @@ class Account(object):
|
|||||||
|
|
||||||
:returns: :class:`deltachat.contact.Contact`
|
:returns: :class:`deltachat.contact.Contact`
|
||||||
"""
|
"""
|
||||||
self.check_is_configured()
|
|
||||||
return Contact(self, const.DC_CONTACT_ID_SELF)
|
return Contact(self, const.DC_CONTACT_ID_SELF)
|
||||||
|
|
||||||
def create_contact(self, email, name=None):
|
def create_contact(self, email, name=None):
|
||||||
|
|||||||
@@ -64,8 +64,7 @@ class TestOfflineAccountBasic:
|
|||||||
|
|
||||||
def test_selfcontact_if_unconfigured(self, acfactory):
|
def test_selfcontact_if_unconfigured(self, acfactory):
|
||||||
ac1 = acfactory.get_unconfigured_account()
|
ac1 = acfactory.get_unconfigured_account()
|
||||||
with pytest.raises(ValueError):
|
assert not ac1.get_self_contact().addr
|
||||||
ac1.get_self_contact()
|
|
||||||
|
|
||||||
def test_selfcontact_configured(self, acfactory):
|
def test_selfcontact_configured(self, acfactory):
|
||||||
ac1 = acfactory.get_configured_offline_account()
|
ac1 = acfactory.get_configured_offline_account()
|
||||||
|
|||||||
Reference in New Issue
Block a user