summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_mailbox.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_mailbox.py')
-rw-r--r--Lib/test/test_mailbox.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py
index 9d50225..e5930d8 100644
--- a/Lib/test/test_mailbox.py
+++ b/Lib/test/test_mailbox.py
@@ -427,8 +427,8 @@ class TestMailboxSuperclass(TestBase):
self.assertRaises(NotImplementedError, lambda: box.__setitem__('', ''))
self.assertRaises(NotImplementedError, lambda: box.keys())
self.assertRaises(NotImplementedError, lambda: box.keys())
- self.assertRaises(NotImplementedError, lambda: box.values().next())
- self.assertRaises(NotImplementedError, lambda: box.__iter__().next())
+ self.assertRaises(NotImplementedError, lambda: box.values().__next__())
+ self.assertRaises(NotImplementedError, lambda: box.__iter__().__next__())
self.assertRaises(NotImplementedError, lambda: box.values())
self.assertRaises(NotImplementedError, lambda: box.items().next())
self.assertRaises(NotImplementedError, lambda: box.items())
@@ -679,7 +679,18 @@ class TestMaildir(TestMailbox):
folder1_alias = box.get_folder('folder1')
self.assert_(folder1_alias._factory is dummy_factory)
+ def test_directory_in_folder (self):
+ # Test that mailboxes still work if there's a stray extra directory
+ # in a folder.
+ for i in range(10):
+ self._box.add(mailbox.Message(_sample_message))
+
+ # Create a stray directory
+ os.mkdir(os.path.join(self._path, 'cur', 'stray-dir'))
+ # Check that looping still works with the directory present.
+ for msg in self._box:
+ pass
class _TestMboxMMDF(TestMailbox):