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-01-21 15:07:19 -0400
commit1f6687d1375ff97f1ad0746e45f91f922866f32d (patch)
treef041b51fa949c3b44e9a53a6e3c51b77fa8a6986 /src/leap/mail/imap/tests/utils.py
parent3357b71f88a0d3e46c7a6ad2471917666b26e55a (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()