diff options
author | Kali Kaneko <kali@leap.se> | 2015-01-06 01:31:26 -0400 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2015-01-21 15:07:19 -0400 |
commit | 751ace7534280187ecc83efb32e0cf9e18ac5bb2 (patch) | |
tree | 27be866d7fb9191096ba0429be9a72321c0b69dc /src/leap/mail/tests | |
parent | 60eecafcc8a516985f900ef81bc7941a5234930a (diff) |
tests for mail.mail module: MessageCollection
Diffstat (limited to 'src/leap/mail/tests')
-rw-r--r-- | src/leap/mail/tests/test_mail.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/leap/mail/tests/test_mail.py b/src/leap/mail/tests/test_mail.py index cb97be5..d11df40 100644 --- a/src/leap/mail/tests/test_mail.py +++ b/src/leap/mail/tests/test_mail.py @@ -259,7 +259,23 @@ class MessageCollectionTestCase(unittest.TestCase, self.fail() def test_delete_msg(self): - self.fail() + d = self.add_msg_to_collection() + + def del_msg(collection): + def _delete_it(msg): + return collection.delete_msg(msg) + + d = collection.get_message_by_uid(1) + d.addCallback(_delete_it) + return d + + d.addCallback(lambda _: self.get_collection()) + d.addCallback(del_msg) + d.addCallback(self._test_delete_msg_cb) + return d + + def _test_delete_msg_cb(self, _): + return partial(self.assert_collection_count, expected=0) def test_update_flags(self): d = self.add_msg_to_collection() |