diff options
author | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-08-06 09:56:12 +0200 |
---|---|---|
committer | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-08-11 17:00:32 +0200 |
commit | 8b38782075fab1410a5f45c79c2cc252ff3d84db (patch) | |
tree | 8e91b31733ebc7ac288719c45562f7af580df7dc /service/test/unit/adapter | |
parent | f4541e455e624747f04d35b3567c40147942c9ce (diff) |
Added move mail to indexing mail store.
Diffstat (limited to 'service/test/unit/adapter')
-rw-r--r-- | service/test/unit/adapter/mailstore/test_searchable_mailstore.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/service/test/unit/adapter/mailstore/test_searchable_mailstore.py b/service/test/unit/adapter/mailstore/test_searchable_mailstore.py index da0755c9..00695a19 100644 --- a/service/test/unit/adapter/mailstore/test_searchable_mailstore.py +++ b/service/test/unit/adapter/mailstore/test_searchable_mailstore.py @@ -77,6 +77,18 @@ class TestSearchableMailStore(TestCase): verify(self.search_index).index_mail(leap_mail) @defer.inlineCallbacks + def test_move_mail_delegates_to_mail_store_and_updates_index(self): + moved_mail = LeapMail('new id', ANY_MAILBOX) + when(self.delegate_mail_store).move_mail_to_mailbox('mail id', ANY_MAILBOX).thenReturn(defer.succeed(moved_mail)) + + result = yield self.store.move_mail_to_mailbox('mail id', ANY_MAILBOX) + + verify(self.delegate_mail_store).move_mail_to_mailbox('mail id', ANY_MAILBOX) + verify(self.search_index).remove_from_index('mail id') + verify(self.search_index).index_mail(moved_mail) + self.assertEqual(moved_mail, result) + + @defer.inlineCallbacks def test_other_methods_are_delegated(self): mail = LeapMail('mail id', ANY_MAILBOX) when(self.delegate_mail_store).get_mail('mail id').thenReturn(defer.succeed(mail), defer.succeed(mail)) |