summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2000-10-23 13:39:15 (GMT)
committerFred Drake <fdrake@acm.org>2000-10-23 13:39:15 (GMT)
commit0aaed272a7e058c5cceb9f79495b575f0176a21f (patch)
treeaa0cfcdc6557a7359404613e5d2f225198bab813
parentde3518e7cabf752cc2066878465957dcf552957d (diff)
downloadcpython-0aaed272a7e058c5cceb9f79495b575f0176a21f.zip
cpython-0aaed272a7e058c5cceb9f79495b575f0176a21f.tar.gz
cpython-0aaed272a7e058c5cceb9f79495b575f0176a21f.tar.bz2
Added test for regression on SourceForge bug #117490.
-rw-r--r--Lib/test/output/test_mailbox2
-rw-r--r--Lib/test/test_mailbox.py28
2 files changed, 30 insertions, 0 deletions
diff --git a/Lib/test/output/test_mailbox b/Lib/test/output/test_mailbox
new file mode 100644
index 0000000..eada229
--- /dev/null
+++ b/Lib/test/output/test_mailbox
@@ -0,0 +1,2 @@
+test_mailbox
+newly created maildir contains 0 messages
diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py
new file mode 100644
index 0000000..e28d721
--- /dev/null
+++ b/Lib/test/test_mailbox.py
@@ -0,0 +1,28 @@
+import mailbox
+import os
+import test_support
+
+# create a new maildir mailbox to work with:
+curdir = os.path.join(test_support.TESTFN, "cur")
+newdir = os.path.join(test_support.TESTFN, "new")
+try:
+ os.mkdir(test_support.TESTFN)
+ os.mkdir(curdir)
+ os.mkdir(newdir)
+
+ # Test for regression on bug #117490:
+ # http://sourceforge.net/bugs/?func=detailbug&bug_id=117490&group_id=5470
+ # Make sure the boxes attribute actually gets set.
+ mbox = mailbox.Maildir(test_support.TESTFN)
+ mbox.boxes
+ print "newly created maildir contains", len(mbox.boxes), "messages"
+
+ # XXX We still need more tests!
+
+finally:
+ try: os.rmdir(newdir)
+ except IOError: pass
+ try: os.rmdir(curdir)
+ except IOError: pass
+ try: os.rmdir(test_support.TESTFN)
+ except IOError: pass