diff options
author | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-08-09 22:09:08 +0200 |
---|---|---|
committer | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-08-11 17:00:33 +0200 |
commit | 46ed5e1731fa0295a7f4b612457069db36bb8e64 (patch) | |
tree | f7b1d81e19f1e86d40c605910063e86feef6eb73 /service/pixelated/adapter/mailstore | |
parent | 319e5e2ddd20444bb30f294a2fd08854dfaae494 (diff) |
Worked on integration tests.
Diffstat (limited to 'service/pixelated/adapter/mailstore')
-rw-r--r-- | service/pixelated/adapter/mailstore/leap_mailstore.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/service/pixelated/adapter/mailstore/leap_mailstore.py b/service/pixelated/adapter/mailstore/leap_mailstore.py index 049af9ee..9261f877 100644 --- a/service/pixelated/adapter/mailstore/leap_mailstore.py +++ b/service/pixelated/adapter/mailstore/leap_mailstore.py @@ -29,8 +29,8 @@ class LeapMail(Mail): self._mailbox_name = mailbox_name self._headers = headers if headers is not None else {} self._body = body - self.tags = tags - self._flags = flags + self.tags = set(tags) # TODO test that asserts copy + self._flags = set(flags) # TODO test that asserts copy @property def headers(self): @@ -77,6 +77,7 @@ class LeapMail(Mail): 'header': {k.lower(): v for k, v in self.headers.items()}, 'ident': self._mail_id, 'tags': self.tags, + 'status': list(self.status), 'body': self._body } @@ -113,7 +114,8 @@ class LeapMailStore(MailStore): def update_mail(self, mail): message = yield self._fetch_msg_from_soledad(mail.mail_id) message.get_wrapper().set_tags(tuple(mail.tags)) - self._update_mail(message) + message.get_wrapper().set_flags(tuple(mail.flags)) + yield self._update_mail(message) # TODO assert this is yielded (otherwise asynchronous) @defer.inlineCallbacks def all_mails(self): @@ -206,7 +208,7 @@ class LeapMailStore(MailStore): mbox_uuid = message.get_wrapper().fdoc.mbox_uuid mbox_name = yield self._mailbox_name_from_uuid(mbox_uuid) - mail = LeapMail(mail_id, mbox_name, message.get_wrapper().hdoc.headers, set(message.get_tags()), body=body) + mail = LeapMail(mail_id, mbox_name, message.get_wrapper().hdoc.headers, set(message.get_tags()), set(message.get_flags()), body=body) # TODO assert flags are passed on defer.returnValue(mail) |