diff options
author | Kali Kaneko (leap communications) <kali@leap.se> | 2017-05-24 14:25:19 +0200 |
---|---|---|
committer | Kali Kaneko (leap communications) <kali@leap.se> | 2017-05-24 14:59:55 +0200 |
commit | cf610930f7a9b56b0378920bfdd4263f490b5cb3 (patch) | |
tree | c6afdc78a8d07fd5d32de6482ef186fa8436f74a /tests/integration/mail/test_mail.py | |
parent | 37b25fd88400df8cc726470b5d897111f2373b96 (diff) |
[tests] fix tests
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 637340d..42b4478 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) |