diff options
Diffstat (limited to 'service/test/unit')
-rw-r--r-- | service/test/unit/adapter/test_mail_service.py | 11 | ||||
-rw-r--r-- | service/test/unit/adapter/test_mailbox.py | 3 |
2 files changed, 9 insertions, 5 deletions
diff --git a/service/test/unit/adapter/test_mail_service.py b/service/test/unit/adapter/test_mail_service.py index 32b45dc4..4b1c60d6 100644 --- a/service/test/unit/adapter/test_mail_service.py +++ b/service/test/unit/adapter/test_mail_service.py @@ -14,8 +14,10 @@ # You should have received a copy of the GNU Affero General Public License # along with Pixelated. If not, see <http://www.gnu.org/licenses/>. import unittest +from pixelated.adapter.model.mail import InputMail from pixelated.adapter.services.mail_service import MailService +from test.support.test_helper import mail_dict from mockito import * @@ -29,14 +31,15 @@ class TestMailService(unittest.TestCase): self.mailboxes.sent = lambda: mock() self.mail_sender = mock() - self.mail_service = MailService(self.mailboxes, self.mail_sender, self.tag_service, self.querier) + self.search_engine = mock() + self.mail_service = MailService(self.mailboxes, self.mail_sender, self.tag_service, self.querier, self.search_engine) def test_send_mail(self): - mail = "mail" + when(InputMail).from_dict(any()).thenReturn('inputmail') - self.mail_service.send(mail) + self.mail_service.send_mail(mail_dict()) - verify(self.mail_sender).sendmail(mail) + verify(self.mail_sender).sendmail("inputmail") def test_mark_as_read(self): mail = mock() diff --git a/service/test/unit/adapter/test_mailbox.py b/service/test/unit/adapter/test_mailbox.py index 9725f418..b44f507b 100644 --- a/service/test/unit/adapter/test_mailbox.py +++ b/service/test/unit/adapter/test_mailbox.py @@ -25,7 +25,8 @@ class PixelatedMailboxTest(unittest.TestCase): def setUp(self): self.tag_service = mock() self.querier = mock() - self.mailbox = Mailbox('INBOX', self.querier) + self.search_engine = mock() + self.mailbox = Mailbox('INBOX', self.querier, self.search_engine) def test_remove_message_from_mailbox(self): mail = PixelatedMail.from_soledad(*test_helper.leap_mail(), soledad_querier=self.querier) |