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/unit/adapter/test_mailbox_indexer_listener.py | |
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/unit/adapter/test_mailbox_indexer_listener.py')
-rw-r--r-- | service/test/unit/adapter/test_mailbox_indexer_listener.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/service/test/unit/adapter/test_mailbox_indexer_listener.py b/service/test/unit/adapter/test_mailbox_indexer_listener.py index c88ba035..c101aa1a 100644 --- a/service/test/unit/adapter/test_mailbox_indexer_listener.py +++ b/service/test/unit/adapter/test_mailbox_indexer_listener.py @@ -31,7 +31,7 @@ class MailboxListenerTest(unittest.TestCase): def test_add_itself_to_mailbox_listeners(self): self.account.mailboxes = ['INBOX'] mailbox = mock() - when(self.account).getMailbox('INBOX').thenReturn(mailbox) + when(self.account).get_collection_by_mailbox('INBOX').thenReturn(mailbox) mailbox.listeners = set() when(mailbox).addListener = lambda x: mailbox.listeners.add(x) @@ -49,7 +49,7 @@ class MailboxListenerTest(unittest.TestCase): listener = MailboxIndexerListener('INBOX', self.mail_store, search_engine) when(self.mail_store).get_mailbox_mail_ids('INBOX').thenReturn({'ident1', 'ident2', 'missing_ident'}) when(self.mail_store).get_mails({'missing_ident'}, include_body=True).thenReturn([mail]) - listener.newMessages(10, 5) + listener.notify_new() verify(self.mail_store, times=1).get_mails({'missing_ident'}, include_body=True) verify(search_engine).index_mails([mail]) @@ -59,6 +59,6 @@ class MailboxListenerTest(unittest.TestCase): when(logger).error(ANY()).thenReturn(None) listener = MailboxIndexerListener('INBOX', self.mail_store, mock()) - yield listener.newMessages(1, 1) + yield listener.notify_new() verify(logger).error(ANY()) |