diff options
author | Duda Dornelles <ddornell@thoughtworks.com> | 2014-11-20 13:43:12 -0200 |
---|---|---|
committer | Duda Dornelles <ddornell@thoughtworks.com> | 2014-11-24 08:21:59 -0200 |
commit | 4f484e4dd2a40c4b3c71cd3d241785fb3a7b2eaf (patch) | |
tree | 09d494d82ac812e87e45c1b1ccc6ff2693b49a62 /service/test/support/integration | |
parent | d4b29e22f51c986e4b8306f1782ef3603248d0d5 (diff) |
Adding contacts controller and basic contact search
Diffstat (limited to 'service/test/support/integration')
-rw-r--r-- | service/test/support/integration/app_test_client.py | 8 | ||||
-rw-r--r-- | service/test/support/integration/soledad_test_base.py | 4 |
2 files changed, 9 insertions, 3 deletions
diff --git a/service/test/support/integration/app_test_client.py b/service/test/support/integration/app_test_client.py index dea59399..229d32d6 100644 --- a/service/test/support/integration/app_test_client.py +++ b/service/test/support/integration/app_test_client.py @@ -17,6 +17,7 @@ import json import multiprocessing import shutil import time +from pixelated.config.routes import setup_routes from klein.test_resource import requestMock, _render from leap.mail.imap.account import SoledadBackedAccount @@ -30,7 +31,7 @@ from pixelated.adapter.soledad_querier import SoledadQuerier from pixelated.adapter.tag_service import TagService from pixelated.config import app_factory from pixelated.controllers import FeaturesController, HomeController, MailsController, TagsController, \ - SyncInfoController, AttachmentsController + SyncInfoController, AttachmentsController, ContactsController import pixelated.runserver from pixelated.adapter.mail import PixelatedMail from pixelated.adapter.search import SearchEngine @@ -70,11 +71,12 @@ class AppTestClient: draft_service=self.draft_service, search_engine=self.search_engine) tags_controller = TagsController(search_engine=self.search_engine) + contacts_controller = ContactsController(search_engine=self.search_engine) sync_info_controller = SyncInfoController() attachments_controller = AttachmentsController(self.soledad_querier) - app_factory._setup_routes(self.app, home_controller, mails_controller, tags_controller, - features_controller, sync_info_controller, attachments_controller) + setup_routes(self.app, home_controller, mails_controller, tags_controller, + features_controller, sync_info_controller, attachments_controller, contacts_controller) def _render(self, request, as_json=True): def get_request_written_data(_=None): diff --git a/service/test/support/integration/soledad_test_base.py b/service/test/support/integration/soledad_test_base.py index 2221679f..a9663144 100644 --- a/service/test/support/integration/soledad_test_base.py +++ b/service/test/support/integration/soledad_test_base.py @@ -81,3 +81,7 @@ class SoledadTestBase(unittest.TestCase): def mark_many_as_read(self, idents): res, req = self.client.post('/mails/read', json.dumps({'idents': idents})) return req + + def get_contacts(self, query): + res, req = self.client.get('/contacts', get_args={'q': query}) + return res
\ No newline at end of file |