From fe29d4dfe352211f2c3f66a08f8db0048a119a8c Mon Sep 17 00:00:00 2001 From: Tulio Casagrande Date: Mon, 4 Apr 2016 14:29:49 -0300 Subject: 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 --- service/test/support/integration/app_test_client.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'service/test/support/integration') 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) -- cgit v1.2.3