summaryrefslogtreecommitdiff
path: root/src/leap/mail/imap/tests/utils.py
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2014-10-16 14:51:53 +0200
committerKali Kaneko <kali@leap.se>2015-02-11 14:05:42 -0400
commit80ed7b9b85686b5d10f359114ca703dba4a5820b (patch)
treef041b51fa949c3b44e9a53a6e3c51b77fa8a6986 /src/leap/mail/imap/tests/utils.py
parentaa619124b9293b12d732e275c7f57b11dcb01f60 (diff)
adapt to soledad 0.7 async API
Diffstat (limited to 'src/leap/mail/imap/tests/utils.py')
-rw-r--r--src/leap/mail/imap/tests/utils.py25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/leap/mail/imap/tests/utils.py b/src/leap/mail/imap/tests/utils.py
index 5339acf..9a3868c 100644
--- a/src/leap/mail/imap/tests/utils.py
+++ b/src/leap/mail/imap/tests/utils.py
@@ -139,31 +139,32 @@ class IMAP4HelperMixin(BaseLeapTest):
###########
- d = defer.Deferred()
+ d_server_ready = defer.Deferred()
+
self.server = LeapIMAPServer(
uuid=UUID, userid=USERID,
contextFactory=self.serverCTX,
- # XXX do we really need this??
soledad=self._soledad)
- self.client = SimpleClient(d, contextFactory=self.clientCTX)
- self.connected = d
-
- # XXX REVIEW-ME.
- # We're adding theAccount here to server
- # but it was also passed to initialization
- # as it was passed to realm.
- # I THINK we ONLY need to do it at one place now.
+ self.client = SimpleClient(
+ d_server_ready, contextFactory=self.clientCTX)
theAccount = SoledadBackedAccount(
USERID,
soledad=self._soledad,
memstore=memstore)
+ d_account_ready = theAccount.callWhenReady(lambda r: None)
LeapIMAPServer.theAccount = theAccount
+ self.connected = defer.gatherResults(
+ [d_server_ready, d_account_ready])
+
+ # XXX FIXME --------------------------------------------
+ # XXX this needs to be done differently,
+ # have to be hooked on initialization callback instead.
# in case we get something from previous tests...
- for mb in self.server.theAccount.mailboxes:
- self.server.theAccount.delete(mb)
+ #for mb in self.server.theAccount.mailboxes:
+ #self.server.theAccount.delete(mb)
# email parser
self.parser = parser.Parser()