From 1074ae5256ee296ec2efe5407a330a933e2e3b78 Mon Sep 17 00:00:00 2001 From: Folker Bernitt Date: Thu, 30 Jul 2015 14:53:50 +0000 Subject: Fixed load-mails for empty case. - Issue #420 --- service/test/unit/maintenance/test_commands.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'service/test/unit/maintenance') 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 -- cgit v1.2.3