diff options
-rw-r--r-- | service/pixelated/adapter/listener.py | 2 | ||||
-rw-r--r-- | service/pixelated/adapter/soledad_querier.py | 2 | ||||
-rw-r--r-- | service/test/unit/adapter/listener_test.py | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/service/pixelated/adapter/listener.py b/service/pixelated/adapter/listener.py index 4bbb6b4f..1ed546fd 100644 --- a/service/pixelated/adapter/listener.py +++ b/service/pixelated/adapter/listener.py @@ -33,7 +33,7 @@ class MailboxListener(object): def newMessages(self, exists, recent): indexed_idents = set(self.SEARCH_ENGINE.search('tag:' + self.mailbox_name.lower())) - soledad_idents = self.querier.get_idents_by_mailbox(self.mailbox_name) + soledad_idents = self.querier.idents_by_mailbox(self.mailbox_name) missing_idents = soledad_idents.difference(indexed_idents) diff --git a/service/pixelated/adapter/soledad_querier.py b/service/pixelated/adapter/soledad_querier.py index 2395420c..35c8780f 100644 --- a/service/pixelated/adapter/soledad_querier.py +++ b/service/pixelated/adapter/soledad_querier.py @@ -89,7 +89,7 @@ class SoledadQuerier: self.soledad.delete_doc(_mail.hdoc) self.soledad.delete_doc(_mail.fdoc) - def get_idents_by_mailbox(self, mailbox_name): + def idents_by_mailbox(self, mailbox_name): return set(doc.content['chash'] for doc in self.soledad.get_from_index('by-type-and-mbox-and-deleted', 'flags', mailbox_name, '0')) def _next_uid_for_mailbox(self, mailbox_name): diff --git a/service/test/unit/adapter/listener_test.py b/service/test/unit/adapter/listener_test.py index ec4b1d93..284c6b16 100644 --- a/service/test/unit/adapter/listener_test.py +++ b/service/test/unit/adapter/listener_test.py @@ -50,10 +50,10 @@ class MailboxListenerTest(unittest.TestCase): listener = MailboxListener('INBOX') listener.querier = querier - when(querier).get_idents_by_mailbox('INBOX').thenReturn({'ident1', 'ident2', 'missing_ident'}) + when(querier).idents_by_mailbox('INBOX').thenReturn({'ident1', 'ident2', 'missing_ident'}) querier.used_arguments = [] querier.mails = lambda x: querier.used_arguments.append(x) listener.newMessages(10, 5) - verify(querier, times=1).get_idents_by_mailbox('INBOX') + verify(querier, times=1).idents_by_mailbox('INBOX') self.assertIn({'missing_ident'}, querier.used_arguments) |