summaryrefslogtreecommitdiff
path: root/service/test
diff options
context:
space:
mode:
authorDuda Dornelles <ddornell@thoughtworks.com>2014-10-22 17:07:47 +0200
committerDuda Dornelles <ddornell@thoughtworks.com>2014-10-23 12:08:31 +0200
commit64d87fd813d999de682b37b3e0b26df33762d338 (patch)
tree591d97c730de4681c49f9e0ad6244c9a85d1b270 /service/test
parentf43b9625e4bf04a4c03a8949c930d623eced02bd (diff)
#117 making partial fetch of all_mails more reliable in case the fdoc of a mail has already been synced but the hdoc hasnt - have to do the same for cdocs
Diffstat (limited to 'service/test')
-rw-r--r--service/test/integration/soledad_querier_test.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/service/test/integration/soledad_querier_test.py b/service/test/integration/soledad_querier_test.py
index 3c1ce6e1..a6d0319f 100644
--- a/service/test/integration/soledad_querier_test.py
+++ b/service/test/integration/soledad_querier_test.py
@@ -17,7 +17,7 @@
import copy
import unittest
import time
-from test.support.integration_helper import SoledadTestBase
+from test.support.integration_helper import SoledadTestBase, MailBuilder
from leap.mail.imap.fields import WithMsgFields
@@ -55,3 +55,14 @@ class SoledadQuerierTest(unittest.TestCase, SoledadTestBase, WithMsgFields):
inboxes = self._get_mailboxes_from_soledad('INBOX')
self.assertEqual(1, len(inboxes))
self.assertEqual(3, inboxes[0].content['lastuid'])
+
+ def test_all_mails_skips_incomplete_mails(self):
+ self.add_multiple_to_mailbox(1, 'INBOX')
+ self.add_multiple_to_mailbox(1, 'SENT')
+
+ # creating incomplete mail, we will only save the fdoc
+ fdoc, hdoc, bdoc = MailBuilder().build_input_mail().get_for_save(2, 'INBOX')
+
+ self.soledad.create_doc(fdoc)
+ mails = self.soledad_querier.all_mails()
+ self.assertEqual(2, len(mails)) # mail is incomplete since it only has fdoc \ No newline at end of file