summaryrefslogtreecommitdiff
path: root/src/leap/mail/tests
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2015-01-06 01:31:26 -0400
committerKali Kaneko <kali@leap.se>2015-02-11 14:05:43 -0400
commitce6008a326dfc8020b341904308115917eabd7de (patch)
tree27be866d7fb9191096ba0429be9a72321c0b69dc /src/leap/mail/tests
parent84888155b09b3af6a755262b28728de2f851c8cb (diff)
tests for mail.mail module: MessageCollection
Diffstat (limited to 'src/leap/mail/tests')
-rw-r--r--src/leap/mail/tests/test_mail.py18
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()