diff options
Diffstat (limited to 'tests/integration/mail/test_mail.py')
-rw-r--r-- | tests/integration/mail/test_mail.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/integration/mail/test_mail.py b/tests/integration/mail/test_mail.py index 637340d5..42b4478e 100644 --- a/tests/integration/mail/test_mail.py +++ b/tests/integration/mail/test_mail.py @@ -313,6 +313,9 @@ class MessageCollectionTestCase(SoledadTestMixin, CollectionMixin): pass +DEFAULT_MBOXES = ['INBOX', 'Sent'] + + class AccountTestCase(SoledadTestMixin): """ Tests for the Account class. @@ -329,12 +332,13 @@ class AccountTestCase(SoledadTestMixin): return d def _test_add_mailbox_cb(self, mboxes): - expected = ['INBOX', 'TestMailbox'] + expected = DEFAULT_MBOXES + ['TestMailbox'] self.assertItemsEqual(mboxes, expected) def test_delete_mailbox(self): acc = self.get_account('some_user_id') - d = acc.callWhenReady(lambda _: acc.delete_mailbox("Inbox")) + d = acc.callWhenReady(lambda _: acc.delete_mailbox('Inbox')) + d.addCallback(lambda _: acc.delete_mailbox('Sent')) d.addCallback(lambda _: acc.list_all_mailbox_names()) d.addCallback(self._test_delete_mailbox_cb) return d @@ -353,7 +357,7 @@ class AccountTestCase(SoledadTestMixin): return d def _test_rename_mailbox_cb(self, mboxes): - expected = ['INBOX', 'RenamedMailbox'] + expected = DEFAULT_MBOXES + ['RenamedMailbox'] self.assertItemsEqual(mboxes, expected) def test_get_all_mailboxes(self): @@ -368,8 +372,9 @@ class AccountTestCase(SoledadTestMixin): return d def _test_get_all_mailboxes_cb(self, mailboxes): - expected = ["INBOX", "OneMailbox", "TwoMailbox", "ThreeMailbox", - "anotherthing", "anotherthing2"] + expected = DEFAULT_MBOXES + [ + "OneMailbox", "TwoMailbox", "ThreeMailbox", "anotherthing", + "anotherthing2"] names = [m.mbox for m in mailboxes] self.assertItemsEqual(names, expected) |