diff options
author | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-07-24 12:01:39 +0200 |
---|---|---|
committer | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-08-11 17:00:28 +0200 |
commit | cda364d86469f79d52936dbfeb451e9809b66564 (patch) | |
tree | c5a098d8e2044553ff9fd03997124845c901c011 /service/test/unit/adapter/mailstore | |
parent | 0916ac8f9857974dc9ccf5eeda22d03f15a0eba3 (diff) |
Added all_mails to LeapMailStore.
Diffstat (limited to 'service/test/unit/adapter/mailstore')
-rw-r--r-- | service/test/unit/adapter/mailstore/test_leap_mailstore.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/service/test/unit/adapter/mailstore/test_leap_mailstore.py b/service/test/unit/adapter/mailstore/test_leap_mailstore.py index 36458d1e..26dd21f0 100644 --- a/service/test/unit/adapter/mailstore/test_leap_mailstore.py +++ b/service/test/unit/adapter/mailstore/test_leap_mailstore.py @@ -156,6 +156,21 @@ class TestLeapMailStore(TestCase): verify(self.soledad).put_doc(soledad_fdoc) self.assertTrue('new_tag' in soledad_fdoc.content['tags']) + @defer.inlineCallbacks + def test_all_mails(self): + first_mdoc_id, _ = self._add_mail_fixture_to_soledad('mbox00000000') + second_mdoc_id, _ = self._add_mail_fixture_to_soledad('mbox00000001') + when(self.soledad).get_from_index('by-type', 'meta').thenReturn(defer.succeed([self.doc_by_id[first_mdoc_id], self.doc_by_id[second_mdoc_id]])) + + store = LeapMailStore(self.soledad) + + mails = yield store.all_mails() + + self.assertIsNotNone(mails) + self.assertEqual(2, len(mails)) + self.assertEqual('Itaque consequatur repellendus provident sunt quia.', mails[0].subject) + self.assertEqual('Error illum dignissimos autem eos aspernatur.', mails[1].subject) + def _add_mail_fixture_to_soledad(self, mail_file): mail = self._load_mail_from_file(mail_file) msg = self._convert_mail_to_leap_message(mail) |