summaryrefslogtreecommitdiff
path: root/service/test/unit/adapter
diff options
context:
space:
mode:
authorFolker Bernitt <fbernitt@thoughtworks.com>2015-08-07 09:43:54 +0200
committerFolker Bernitt <fbernitt@thoughtworks.com>2015-08-11 17:00:33 +0200
commit8585a186716a4f45132e3c9eea90a792ca76c2a2 (patch)
treeff5835eaca6e1b18d6a0b8b9e84ed1ef8b3cd9fc /service/test/unit/adapter
parent6b588bb4cb93f8e265d044ea784cb18b7021b26c (diff)
Fix test_delete_mail by moving expectations onto mail_store
Diffstat (limited to 'service/test/unit/adapter')
-rw-r--r--service/test/unit/adapter/test_mail_service.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/service/test/unit/adapter/test_mail_service.py b/service/test/unit/adapter/test_mail_service.py
index 1f88ca8d..9d1521b8 100644
--- a/service/test/unit/adapter/test_mail_service.py
+++ b/service/test/unit/adapter/test_mail_service.py
@@ -14,6 +14,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
from twisted.trial import unittest
+from pixelated.adapter.mailstore.leap_mailstore import LeapMail
from pixelated.adapter.model.mail import InputMail, PixelatedMail
from pixelated.adapter.services.mail_service import MailService
@@ -87,12 +88,12 @@ class TestMailService(unittest.TestCase):
verify(mail).mark_as_read()
def test_delete_mail(self):
- mail_to_delete = PixelatedMail.from_soledad(*leap_mail(), soledad_querier=None)
- when(self.mail_service).mail(1).thenReturn(mail_to_delete)
+ mail_to_delete = LeapMail(1, 'INBOX')
+ when(self.mail_store).get_mail(1).thenReturn(mail_to_delete)
self.mail_service.delete_mail(1)
- verify(self.mailboxes).move_to_trash(1)
+ verify(self.mail_store).move_mail_to_mailbox(1, 'TRASH')
def test_recover_mail(self):
mail_to_recover = PixelatedMail.from_soledad(*leap_mail(), soledad_querier=None)