summaryrefslogtreecommitdiff
path: root/service/test/unit
diff options
context:
space:
mode:
Diffstat (limited to 'service/test/unit')
-rw-r--r--service/test/unit/adapter/test_mail.py2
-rw-r--r--service/test/unit/bitmask_libraries/test_session.py2
-rw-r--r--service/test/unit/maintenance/test_commands.py10
3 files changed, 5 insertions, 9 deletions
diff --git a/service/test/unit/adapter/test_mail.py b/service/test/unit/adapter/test_mail.py
index 1a9280ff..92b1e905 100644
--- a/service/test/unit/adapter/test_mail.py
+++ b/service/test/unit/adapter/test_mail.py
@@ -22,7 +22,7 @@ from mockito import mock, unstub, when
from test.support import test_helper
import dateutil.parser as dateparser
import base64
-from leap.mail.imap.fields import fields
+from leap.mail.adaptors import soledad_indexes as fields
from datetime import datetime
import os
import json
diff --git a/service/test/unit/bitmask_libraries/test_session.py b/service/test/unit/bitmask_libraries/test_session.py
index 0c662ecb..93f32445 100644
--- a/service/test/unit/bitmask_libraries/test_session.py
+++ b/service/test/unit/bitmask_libraries/test_session.py
@@ -61,7 +61,7 @@ class SessionTest(AbstractLeapTest):
self.soledad_session.sync.assert_called_once_with()
def _create_session(self):
- return LeapSession(self.provider, self.auth, self.soledad_session, self.nicknym, self.soledad_account,
+ return LeapSession(self.provider, self.auth, self.soledad_session, self.nicknym,
self.mail_fetcher_mock, self.smtp_mock)
diff --git a/service/test/unit/maintenance/test_commands.py b/service/test/unit/maintenance/test_commands.py
index f1bf6e45..7279f7a6 100644
--- a/service/test/unit/maintenance/test_commands.py
+++ b/service/test/unit/maintenance/test_commands.py
@@ -18,8 +18,7 @@ import email
from pixelated.maintenance import delete_all_mails, load_mails
from pixelated.bitmask_libraries.session import LeapSession
-from leap.mail.imap.account import SoledadBackedAccount
-from leap.mail.imap.fields import WithMsgFields
+from leap.mail.constants import MessageFlags
from leap.soledad.client import Soledad
from leap.soledad.common.document import SoledadDocument
from mock import MagicMock
@@ -32,10 +31,7 @@ class TestCommands(unittest.TestCase):
def setUp(self):
self.leap_session = MagicMock(spec=LeapSession)
self.soledad = MagicMock(spec=Soledad)
- self.account = MagicMock(spec=SoledadBackedAccount)
self.mailbox = MagicMock()
- self.leap_session.account = self.account
- self.account.getMailbox.return_value = self.mailbox
self.args = (self.leap_session, self.soledad)
@@ -92,8 +88,8 @@ class TestCommands(unittest.TestCase):
# then
def assert_mails_added(_):
self.assertTrue(self.mailbox.addMessage.called)
- self.mailbox.addMessage.assert_any_call(self._mail_content(join(mail_root, 'new', 'mbox00000000')), flags=(WithMsgFields.RECENT_FLAG,), notify_on_disk=False)
- self.mailbox.addMessage.assert_any_call(self._mail_content(join(mail_root, 'new', 'mbox00000001')), flags=(WithMsgFields.RECENT_FLAG,), notify_on_disk=False)
+ self.mailbox.addMessage.assert_any_call(self._mail_content(join(mail_root, 'new', 'mbox00000000')), flags=(MessageFlags.RECENT_FLAG,), notify_on_disk=False)
+ self.mailbox.addMessage.assert_any_call(self._mail_content(join(mail_root, 'new', 'mbox00000001')), flags=(MessageFlags.RECENT_FLAG,), notify_on_disk=False)
def error_callack(err):
print err