summaryrefslogtreecommitdiff
path: root/service/test/support/integration
diff options
context:
space:
mode:
authormnandri <mnandri@eunglick.corporate.thoughtworks.com>2015-12-17 18:41:58 +0100
committermnandri <mnandri@eunglick.corporate.thoughtworks.com>2015-12-18 11:22:34 +0100
commit06ac408dbd7629d387dd7b311a26c144ee56631e (patch)
treec263a0586628b627076b12132166322714394256 /service/test/support/integration
parent39fa6e68fc2afaafc0e8440d212b464d2e20c326 (diff)
extracted a leap attachment store, handling all attachment responsibilities, including saving attachments.
Issue #548
Diffstat (limited to 'service/test/support/integration')
-rw-r--r--service/test/support/integration/app_test_client.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/service/test/support/integration/app_test_client.py b/service/test/support/integration/app_test_client.py
index 5f7eb90a..89f42532 100644
--- a/service/test/support/integration/app_test_client.py
+++ b/service/test/support/integration/app_test_client.py
@@ -31,6 +31,7 @@ from twisted.internet import reactor, defer
from twisted.internet.defer import succeed
from twisted.web.resource import getChildForRequest
# from twisted.web.server import Site as PixelatedSite
+from pixelated.adapter.mailstore.leap_attachment_store import LeapAttachmentStore
from pixelated.adapter.services.feedback_service import FeedbackService
from pixelated.config.site import PixelatedSite
@@ -70,6 +71,7 @@ class AppTestClient(object):
self.mail_sender = self._create_mail_sender()
self.mail_store = SearchableMailStore(LeapMailStore(self.soledad), self.search_engine)
+ self.attachment_store = LeapAttachmentStore(self.soledad)
account_ready_cb = defer.Deferred()
self.account = IMAPAccount(self.ACCOUNT, self.soledad, account_ready_cb)
@@ -78,7 +80,7 @@ class AppTestClient(object):
self.leap_session = mock()
self.feedback_service = FeedbackService(self.leap_session)
- self.mail_service = self._create_mail_service(self.mail_sender, self.mail_store, self.search_engine)
+ self.mail_service = self._create_mail_service(self.mail_sender, self.mail_store, self.search_engine, self.attachment_store)
mails = yield self.mail_service.all_mails()
self.search_engine.index_mails(mails)
@@ -166,8 +168,8 @@ class AppTestClient(object):
mail_sender.sendmail.side_effect = lambda mail: succeed(mail)
return mail_sender
- def _create_mail_service(self, mail_sender, mail_store, search_engine):
- mail_service = MailService(mail_sender, mail_store, search_engine, self.MAIL_ADDRESS)
+ def _create_mail_service(self, mail_sender, mail_store, search_engine, attachment_store):
+ mail_service = MailService(mail_sender, mail_store, search_engine, self.MAIL_ADDRESS, attachment_store)
return mail_service
def _generate_soledad_test_folder_name(self, soledad_test_folder='/tmp/soledad-test/test'):