Updated for 2.1b2 distribution.
[python/dscho.git] / Lib / test / test_mailbox.py
blob382a42e774fc618bc1eaef8f66cbcba5fb80530b
1 import mailbox
2 import os
3 import test_support
5 # create a new maildir mailbox to work with:
6 curdir = os.path.join(test_support.TESTFN, "cur")
7 newdir = os.path.join(test_support.TESTFN, "new")
8 try:
9 os.mkdir(test_support.TESTFN)
10 os.mkdir(curdir)
11 os.mkdir(newdir)
13 # Test for regression on bug #117490:
14 # http://sourceforge.net/bugs/?func=detailbug&bug_id=117490&group_id=5470
15 # Make sure the boxes attribute actually gets set.
16 mbox = mailbox.Maildir(test_support.TESTFN)
17 mbox.boxes
18 print "newly created maildir contains", len(mbox.boxes), "messages"
20 # XXX We still need more tests!
22 finally:
23 try: os.rmdir(newdir)
24 except os.error: pass
25 try: os.rmdir(curdir)
26 except os.error: pass
27 try: os.rmdir(test_support.TESTFN)
28 except os.error: pass