summaryrefslogtreecommitdiff
path: root/service/test/unit/adapter/test_mail_service.py
diff options
context:
space:
mode:
authorGiovane <giovaneliberato@gmail.com>2016-01-14 18:34:00 -0200
committerBruno Wagner <bwagner@riseup.net>2016-01-15 11:11:55 -0200
commitcd831d1dfc42c2a0d292fe5c1b7f497b2ca393eb (patch)
tree4069da65211b163f7718b8628349976748a6d0ee /service/test/unit/adapter/test_mail_service.py
parent36972dc55f64100f4e056130cc1d32a266785a41 (diff)
Removes InputMail.FROM_EMAIL_ADDRESS constant #578
- Created the replier component to generate the reply dict for the email. This was needed to decouple the InputMail from the need to know who is the logged user.
Diffstat (limited to 'service/test/unit/adapter/test_mail_service.py')
-rw-r--r--service/test/unit/adapter/test_mail_service.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/service/test/unit/adapter/test_mail_service.py b/service/test/unit/adapter/test_mail_service.py
index 27c80fde..a8b6d597 100644
--- a/service/test/unit/adapter/test_mail_service.py
+++ b/service/test/unit/adapter/test_mail_service.py
@@ -45,7 +45,7 @@ class TestMailService(unittest.TestCase):
def test_send_mail(self):
input_mail = InputMail()
- when(InputMail).from_dict(ANY()).thenReturn(input_mail)
+ when(InputMail).from_dict(ANY(), ANY()).thenReturn(input_mail)
when(self.mail_sender).sendmail(ANY()).thenReturn(defer.Deferred())
sent_deferred = self.mail_service.send_mail(mail_dict())
@@ -60,7 +60,7 @@ class TestMailService(unittest.TestCase):
def test_send_mail_removes_draft(self):
mail = LeapMail('id', 'INBOX')
when(mail).raw = 'raw mail'
- when(InputMail).from_dict(ANY()).thenReturn(mail)
+ when(InputMail).from_dict(ANY(), ANY()).thenReturn(mail)
when(self.mail_store).delete_mail('12').thenReturn(defer.succeed(None))
when(self.mail_store).add_mail('SENT', ANY()).thenReturn(mail)
@@ -77,7 +77,7 @@ class TestMailService(unittest.TestCase):
def test_send_mail_marks_as_read(self):
mail = InputMail()
when(mail).raw = 'raw mail'
- when(InputMail).from_dict(ANY()).thenReturn(mail)
+ when(InputMail).from_dict(ANY(), ANY()).thenReturn(mail)
when(self.mail_store).delete_mail('12').thenReturn(defer.succeed(None))
when(self.mail_sender).sendmail(mail).thenReturn(defer.succeed(None))
@@ -93,7 +93,7 @@ class TestMailService(unittest.TestCase):
@defer.inlineCallbacks
def test_send_mail_does_not_delete_draft_on_error(self):
input_mail = InputMail()
- when(InputMail).from_dict(ANY()).thenReturn(input_mail)
+ when(InputMail).from_dict(ANY(), ANY()).thenReturn(input_mail)
deferred_failure = defer.fail(Exception("Assume sending mail failed"))
when(self.mail_sender).sendmail(ANY()).thenReturn(deferred_failure)