From 642efe6ae09c770161b22825861f21191fda8197 Mon Sep 17 00:00:00 2001 From: Jonathan Dowland Date: Wed, 25 Jun 2014 08:45:37 +0100 Subject: [PATCH 2/4] add tests for deleting Maildir and singleFileMailbox --- test_mailbox.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test_mailbox.py b/test_mailbox.py index d405093..db5d931 100755 --- a/test_mailbox.py +++ b/test_mailbox.py @@ -868,6 +868,12 @@ class TestMaildir(TestMailbox, unittest.TestCase): for msg in self._box: pass + def test_delete (self): + # test deleting the Maildir + self.assertTrue(os.path.isdir(self._box._path)) + self._box.delete() + self.assertFalse(os.path.isfile(self._box._path)) + @unittest.skipUnless(hasattr(os, 'umask'), 'test needs os.umask()') @unittest.skipUnless(hasattr(os, 'stat'), 'test needs os.stat()') def test_file_permissions(self): @@ -979,6 +985,11 @@ class _TestSingleFile(TestMailbox): self.assertEqual(os.stat(self._path).st_mode, mode) + def test_delete_singlefile_mbox(self): + # test deleting a single-file mailbox + self.assertTrue(os.path.isfile(self._box._path)) + self._box.delete() + self.assertFalse(os.path.isfile(self._box._path)) class _TestMboxMMDF(_TestSingleFile): -- 1.8.5.2 (Apple Git-48)