summaryrefslogtreecommitdiff
path: root/service/test/unit/maintenance
diff options
context:
space:
mode:
authorFolker Bernitt <fbernitt@thoughtworks.com>2015-07-30 14:53:50 +0000
committerFolker Bernitt <fbernitt@thoughtworks.com>2015-08-11 17:00:30 +0200
commit1074ae5256ee296ec2efe5407a330a933e2e3b78 (patch)
treeee7d14c972df4199244368d06210e883666d79c9 /service/test/unit/maintenance
parentb00fd0c00b210ea0d23b9d097e9c68801a6506cb (diff)
Fixed load-mails for empty case.
- Issue #420
Diffstat (limited to 'service/test/unit/maintenance')
-rw-r--r--service/test/unit/maintenance/test_commands.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/service/test/unit/maintenance/test_commands.py b/service/test/unit/maintenance/test_commands.py
index 6e097cea..8a573766 100644
--- a/service/test/unit/maintenance/test_commands.py
+++ b/service/test/unit/maintenance/test_commands.py
@@ -18,12 +18,13 @@ import email
from pixelated.maintenance import delete_all_mails, load_mails
from pixelated.bitmask_libraries.session import LeapSession
+from pixelated.adapter.mailstore import MailStore
from leap.mail.constants import MessageFlags
from leap.mail.imap.account import IMAPAccount
from leap.soledad.client import Soledad
from leap.soledad.common.document import SoledadDocument
from mock import MagicMock
-from os.path import join, dirname
+from os.path import join
from twisted.internet import defer, reactor
import pkg_resources
@@ -35,7 +36,9 @@ class TestCommands(unittest.TestCase):
self.soledad = MagicMock(spec=Soledad)
self.account = MagicMock(spec=IMAPAccount)
self.mailbox = MagicMock()
+ self.mail_store = MagicMock(spec=MailStore)
self.leap_session.account = self.account
+ self.leap_session.mail_store = self.mail_store
self.args = (self.leap_session, self.soledad)
@@ -77,7 +80,7 @@ class TestCommands(unittest.TestCase):
def test_load_mails_empty_path_list(self):
load_mails(self.args, [])
- self.assertFalse(self.mailbox.called)
+ self.assertFalse(self.mail_store.add_mailbox.called)
def test_load_mails_adds_mails(self):
# given