From cd4dffcfcb3f7473913e2b50571a182689efeedc Mon Sep 17 00:00:00 2001 From: Duda Dornelles Date: Mon, 13 Oct 2014 19:29:36 +0200 Subject: No more tag_index - now whoosh does everythin --- service/test/support/integration_helper.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'service/test/support') diff --git a/service/test/support/integration_helper.py b/service/test/support/integration_helper.py index 8f42e335..326ec7cd 100644 --- a/service/test/support/integration_helper.py +++ b/service/test/support/integration_helper.py @@ -23,7 +23,6 @@ import shutil from pixelated.adapter.mail_service import MailService from pixelated.adapter.search import SearchEngine from pixelated.adapter.status import Status -from pixelated.adapter.tag_index import TagIndex from pixelated.adapter.tag_service import TagService from pixelated.adapter.draft_service import DraftService import pixelated.user_agent @@ -102,6 +101,10 @@ class MailBuilder: self.mail['body'] = body return self + def with_tags(self, *tags): + self.mail['tags'] = tags + return self + def with_subject(self, subject): self.mail['header']['subject'] = subject return self @@ -146,8 +149,7 @@ class SoledadTestBase: self.account = FakeAccount() self.pixelated_mailboxes = PixelatedMailBoxes(self.account) self.mail_sender = mock() - self.tag_index = TagIndex(os.path.join(soledad_test_folder, 'tag_index')) - self.tag_service = TagService(self.tag_index) + self.tag_service = TagService() self.draft_service = DraftService(self.pixelated_mailboxes) self.mail_service = MailService(self.pixelated_mailboxes, self.mail_sender, self.tag_service) @@ -177,6 +179,10 @@ class SoledadTestBase: return json.loads( self.app.post('/mail/' + mail_ident + '/tags', data=tags_json, content_type="application/json").data) + def get_tags(self, query_string=""): + return json.loads( + self.app.get('/tags' + query_string, content_type="application/json").data) + def delete_mail(self, mail_ident): self.app.delete('/mail/' + mail_ident) @@ -191,6 +197,7 @@ class SoledadTestBase: def add_mail_to_inbox(self, input_mail): mail = self.pixelated_mailboxes.inbox().add(input_mail) + mail.update_tags(input_mail.tags) self.search_engine.index_mail(mail) -- cgit v1.2.3