Kaydet (Commit) 0aaed272 authored tarafından Fred Drake's avatar Fred Drake

Added test for regression on SourceForge bug #117490.

üst de3518e7
test_mailbox
newly created maildir contains 0 messages
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment