summaryrefslogtreecommitdiff
path: root/src/leap/mail/tests
diff options
context:
space:
mode:
authorCaio Carrara <ccarrara@thoughtworks.com>2016-04-13 16:12:09 -0300
committerKali Kaneko <kali@leap.se>2016-04-15 16:10:42 -0400
commitd8ee6357c518a17a243840e42aeeae948bc03b2f (patch)
treea178aee1d356140e866a71553d7198cfd4a2fb68 /src/leap/mail/tests
parentec7ccd73dd80b51c349fc6240d5bc2a7a556fbd4 (diff)
[bug] Adds user_id to Account
Previously Account used user id from the store, but this attribute is optional and None by default. This caused the collection_mapping to be unable to distinct between multiple users message collections. This chance adds a non optional user_id attribute to Account and use it to index the collection_mapping. - Resolves: https://github.com/pixelated/pixelated-user-agent/issues/674 - Releases: 0.4.0
Diffstat (limited to 'src/leap/mail/tests')
-rw-r--r--src/leap/mail/tests/test_mail.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/leap/mail/tests/test_mail.py b/src/leap/mail/tests/test_mail.py
index 9f40ffb..aca406f 100644
--- a/src/leap/mail/tests/test_mail.py
+++ b/src/leap/mail/tests/test_mail.py
@@ -317,12 +317,12 @@ class AccountTestCase(SoledadTestMixin):
"""
Tests for the Account class.
"""
- def get_account(self):
+ def get_account(self, user_id):
store = self._soledad
- return Account(store)
+ return Account(store, user_id)
def test_add_mailbox(self):
- acc = self.get_account()
+ acc = self.get_account('some_user_id')
d = acc.callWhenReady(lambda _: acc.add_mailbox("TestMailbox"))
d.addCallback(lambda _: acc.list_all_mailbox_names())
d.addCallback(self._test_add_mailbox_cb)
@@ -333,7 +333,7 @@ class AccountTestCase(SoledadTestMixin):
self.assertItemsEqual(mboxes, expected)
def test_delete_mailbox(self):
- acc = self.get_account()
+ acc = self.get_account('some_user_id')
d = acc.callWhenReady(lambda _: acc.delete_mailbox("Inbox"))
d.addCallback(lambda _: acc.list_all_mailbox_names())
d.addCallback(self._test_delete_mailbox_cb)
@@ -344,7 +344,7 @@ class AccountTestCase(SoledadTestMixin):
self.assertItemsEqual(mboxes, expected)
def test_rename_mailbox(self):
- acc = self.get_account()
+ acc = self.get_account('some_user_id')
d = acc.callWhenReady(lambda _: acc.add_mailbox("OriginalMailbox"))
d.addCallback(lambda _: acc.rename_mailbox(
"OriginalMailbox", "RenamedMailbox"))
@@ -357,7 +357,7 @@ class AccountTestCase(SoledadTestMixin):
self.assertItemsEqual(mboxes, expected)
def test_get_all_mailboxes(self):
- acc = self.get_account()
+ acc = self.get_account('some_user_id')
d = acc.callWhenReady(lambda _: acc.add_mailbox("OneMailbox"))
d.addCallback(lambda _: acc.add_mailbox("TwoMailbox"))
d.addCallback(lambda _: acc.add_mailbox("ThreeMailbox"))
@@ -374,7 +374,7 @@ class AccountTestCase(SoledadTestMixin):
self.assertItemsEqual(names, expected)
def test_get_collection_by_mailbox(self):
- acc = self.get_account()
+ acc = self.get_account('some_user_id')
d = acc.callWhenReady(lambda _: acc.get_collection_by_mailbox("INBOX"))
d.addCallback(self._test_get_collection_by_mailbox_cb)
return d