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

add basic create contact API

This commit is contained in:
holger krekel 2018-09-07 20:01:46 +02:00
parent a244393860
commit b153089d4c
4 changed files with 44 additions and 7 deletions

View file

@ -30,12 +30,13 @@ def acfactory(pytestconfig, tmpdir, request):
self.configlist.append(d)
self.count = 0
def get_live_account(self, logcallback=None):
def get_live_account(self, logcallback=None, started=True):
configdict = self.configlist.pop(0)
tmpdb = tmpdir.join("testdb%d" % self.count)
ac = Account(tmpdb.strpath, logcallback=logcallback)
ac.set_config(**configdict)
ac.start()
if started:
ac.start()
request.addfinalizer(ac.shutdown)
return ac

View file

@ -8,6 +8,15 @@ except ImportError:
class TestLive:
def test_contacts(self, acfactory):
ac1 = acfactory.get_live_account(started=False)
contact1 = ac1.create_contact("some1@hello.com", name="some1")
assert contact1.id
assert contact1.addr == "some1@hello.com"
assert contact1.display_name == "some1"
assert not contact1.is_blocked
assert not contact1.is_verified
def test_basic_configure_login_ok(self, acfactory):
q = Queue()
ac1 = acfactory.get_live_account(logcallback=q.put)