diff options
author | Tulio Casagrande <tcasagra@thoughtworks.com> | 2016-04-04 14:29:49 -0300 |
---|---|---|
committer | Tulio Casagrande <tcasagra@thoughtworks.com> | 2016-04-04 14:29:49 -0300 |
commit | fe29d4dfe352211f2c3f66a08f8db0048a119a8c (patch) | |
tree | 93339dac6bcee7901f0006ed77dfbeaa2c000e99 /service/test/support | |
parent | 62e18f6845c28676a5b0e3f794cacf29112a580e (diff) |
Migrate ImapAccount to Account
Migrate all usage of leap.ImapAccount to leap.Account
We had to adapt some calls because of signature changes and, because
we need the Account to be initialized before moving on, we are directly
using the deferred initialization that the account has
See: https://github.com/leapcode/leap_mail/pull/228
Diffstat (limited to 'service/test/support')
-rw-r--r-- | service/test/support/integration/app_test_client.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/service/test/support/integration/app_test_client.py b/service/test/support/integration/app_test_client.py index f3ec5d25..95facec0 100644 --- a/service/test/support/integration/app_test_client.py +++ b/service/test/support/integration/app_test_client.py @@ -25,7 +25,7 @@ import uuid import random -from leap.mail.imap.account import IMAPAccount +from leap.mail.mail import Account from leap.soledad.client import Soledad from mock import Mock from twisted.internet import reactor, defer @@ -77,7 +77,7 @@ class AppTestAccount(object): self.mail_store = SearchableMailStore(LeapMailStore(self.soledad), self.search_engine) self.attachment_store = LeapAttachmentStore(self.soledad) - yield self._initialize_imap_account() + yield self._initialize_account() self.draft_service = DraftService(self.mail_store) self.leap_session = mock() @@ -110,10 +110,9 @@ class AppTestAccount(object): soledad_test_folder = os.path.join(self._leap_home, self._uuid) shutil.rmtree(soledad_test_folder) - def _initialize_imap_account(self): - account_ready_cb = defer.Deferred() - self.account = IMAPAccount(self._user_id, self.soledad, account_ready_cb) - return account_ready_cb + def _initialize_account(self): + self.account = Account(self.soledad) + return self.account.deferred_initialization def _create_mail_service(self, mail_sender, mail_store, search_engine, attachment_store): return MailService(mail_sender, mail_store, search_engine, self._mail_address, attachment_store) |