summaryrefslogtreecommitdiff
path: root/service/test
diff options
context:
space:
mode:
authorDuda Dornelles <ddornell@thoughtworks.com>2014-10-23 12:08:02 +0200
committerDuda Dornelles <ddornell@thoughtworks.com>2014-10-23 12:08:31 +0200
commit5c56864305db45f33ac1b1bda0552a7e59ff3bf2 (patch)
tree25f362fc63a67dab2a4d5b72c2729b5252f1c470 /service/test
parentc2bc082b710297dc9b66d8895e9b756a24b87c6a (diff)
Improving test on soldeda_querier all_mails to make it more robust and
deleting marking recent flags for all mailboxes
Diffstat (limited to 'service/test')
-rw-r--r--service/test/integration/soledad_querier_test.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/service/test/integration/soledad_querier_test.py b/service/test/integration/soledad_querier_test.py
index a6d0319f..f6e9f26f 100644
--- a/service/test/integration/soledad_querier_test.py
+++ b/service/test/integration/soledad_querier_test.py
@@ -57,12 +57,21 @@ class SoledadQuerierTest(unittest.TestCase, SoledadTestBase, WithMsgFields):
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')
-
+ fdoc, hdoc, bdoc = MailBuilder().build_input_mail().get_for_save(1, 'INBOX')
self.soledad.create_doc(fdoc)
+
+ mails = self.soledad_querier.all_mails()
+ self.assertEqual(0, len(mails)) # mail is incomplete since it only has fdoc
+
+ # adding the hdoc still doesn't complete the mail
+ self.soledad.create_doc(hdoc)
+
+ mails = self.soledad_querier.all_mails()
+ self.assertEqual(0, len(mails))
+
+ # now the mail is complete
+ self.soledad.put_doc(bdoc)
+
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
+ self.assertEqual(1, len(mails))