From 43d100efa25702df969b64de8fcf115a8fc45f02 Mon Sep 17 00:00:00 2001 From: Jonathan Dowland Date: Mon, 30 Jun 2014 17:07:11 +0100 Subject: [PATCH 3/4] test for deletion of sub-folders --- test_mailbox.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test_mailbox.py b/test_mailbox.py index db5d931..7fa7b1b 100755 --- a/test_mailbox.py +++ b/test_mailbox.py @@ -872,7 +872,16 @@ class TestMaildir(TestMailbox, unittest.TestCase): # test deleting the Maildir self.assertTrue(os.path.isdir(self._box._path)) self._box.delete() - self.assertFalse(os.path.isfile(self._box._path)) + self.assertFalse(os.path.isdir(self._box._path)) + + # test that sub-folders are preserved + self.test_initialize_existing() + self._box.add_folder('one') + self._box.delete() + self.assertFalse(os.path.isdir(os.path.join(self._box._path,'cur'))) + self.assertTrue(os.path.isdir(self._box._path)) + one = self._box.get_folder('one') + self.assertTrue(one._path) @unittest.skipUnless(hasattr(os, 'umask'), 'test needs os.umask()') @unittest.skipUnless(hasattr(os, 'stat'), 'test needs os.stat()') -- 1.8.5.2 (Apple Git-48)