diff options
author | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-08-07 09:30:51 +0200 |
---|---|---|
committer | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-08-11 17:00:33 +0200 |
commit | 6b588bb4cb93f8e265d044ea784cb18b7021b26c (patch) | |
tree | 01eacc11e8c6bf0a21312cc9b9295f68872130a0 /service/test/support | |
parent | 08497951fa9aed8d28be8b2dea1aef2135f56769 (diff) |
Changed test_delete_mail.py integration test to new mail store.
- intermediate state, some tests are broken
Diffstat (limited to 'service/test/support')
-rw-r--r-- | service/test/support/integration/app_test_client.py | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/service/test/support/integration/app_test_client.py b/service/test/support/integration/app_test_client.py index 28d378b3..ee305c69 100644 --- a/service/test/support/integration/app_test_client.py +++ b/service/test/support/integration/app_test_client.py @@ -141,24 +141,33 @@ class AppTestClient(object): @defer.inlineCallbacks def add_mail_to_inbox(self, input_mail): - inbox = yield self.mailboxes.inbox - mail = yield inbox.add(input_mail) - if input_mail.tags: - mail.update_tags(input_mail.tags) - self.search_engine.index_mail(mail) + mail = yield self.mail_store.add_mail('INBOX', input_mail.raw) + defer.returnValue(mail) + # inbox = yield self.mailboxes.inbox + # mail = yield inbox.add(input_mail) + # if input_mail.tags: + # mail.update_tags(input_mail.tags) + # self.search_engine.index_mail(mail) @defer.inlineCallbacks def add_multiple_to_mailbox(self, num, mailbox='', flags=[], tags=[], to='recipient@to.com', cc='recipient@cc.com', bcc='recipient@bcc.com'): mails = [] + yield self.mail_store.add_mailbox(mailbox) for _ in range(num): builder = MailBuilder().with_status(flags).with_tags(tags).with_to(to).with_cc(cc).with_bcc(bcc) builder.with_body(str(random.random())) input_mail = builder.build_input_mail() - mbx = yield self.mailboxes._create_or_get(mailbox) - mail = yield mbx.add(input_mail) + mail = yield self.mail_store.add_mail(mailbox, input_mail.raw) + if tags: + mail.tags.add(tags) + yield self.mail_store.update_mail(mail) mails.append(mail) - mail.update_tags(input_mail.tags) if tags else None - self.search_engine.index_mails(mails) if tags else None + + # mbx = yield self.mailboxes._create_or_get(mailbox) + # mail = yield mbx.add(input_mail) + # mails.append(mail) + # mail.update_tags(input_mail.tags) if tags else None + # self.search_engine.index_mails(mails) if tags else None defer.returnValue(mails) |