diff options
author | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-08-06 10:16:03 +0200 |
---|---|---|
committer | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-08-11 17:00:32 +0200 |
commit | 5081bc601334a163c362d6a049cf13c837b0fc42 (patch) | |
tree | 3e389c8cb65c576a1b51746fd48b8f050dac9343 /service/test/unit/adapter | |
parent | 8b38782075fab1410a5f45c79c2cc252ff3d84db (diff) |
Implemented copy mail on indexing mails store.
Diffstat (limited to 'service/test/unit/adapter')
-rw-r--r-- | service/test/unit/adapter/mailstore/test_searchable_mailstore.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/service/test/unit/adapter/mailstore/test_searchable_mailstore.py b/service/test/unit/adapter/mailstore/test_searchable_mailstore.py index 00695a19..cae6b2f3 100644 --- a/service/test/unit/adapter/mailstore/test_searchable_mailstore.py +++ b/service/test/unit/adapter/mailstore/test_searchable_mailstore.py @@ -77,13 +77,22 @@ class TestSearchableMailStore(TestCase): verify(self.search_index).index_mail(leap_mail) @defer.inlineCallbacks + def test_copy_mail_delegates_to_mail_store_and_updates_index(self): + copied_mail = LeapMail('new id', ANY_MAILBOX) + when(self.delegate_mail_store).copy_mail_to_mailbox('mail id', ANY_MAILBOX).thenReturn(defer.succeed(copied_mail)) + + result = yield self.store.copy_mail_to_mailbox('mail id', ANY_MAILBOX) + + verify(self.search_index).index_mail(copied_mail) + self.assertEqual(copied_mail, result) + + @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) |