blob: 1d1a063720572203a4e8ccb243dc8a030c31228b [file] [log] [blame]
Fred Drake0aaed272000-10-23 13:39:15 +00001import mailbox
2import os
3import test_support
4
Guido van Rossum75ebb292001-04-10 15:01:20 +00005# cleanup
6try:
7 os.unlink(test_support.TESTFN)
8except os.error:
9 pass
10
Fred Drake0aaed272000-10-23 13:39:15 +000011# create a new maildir mailbox to work with:
12curdir = os.path.join(test_support.TESTFN, "cur")
13newdir = os.path.join(test_support.TESTFN, "new")
14try:
15 os.mkdir(test_support.TESTFN)
16 os.mkdir(curdir)
17 os.mkdir(newdir)
18
19 # Test for regression on bug #117490:
20 # http://sourceforge.net/bugs/?func=detailbug&bug_id=117490&group_id=5470
21 # Make sure the boxes attribute actually gets set.
22 mbox = mailbox.Maildir(test_support.TESTFN)
23 mbox.boxes
24 print "newly created maildir contains", len(mbox.boxes), "messages"
25
26 # XXX We still need more tests!
27
28finally:
29 try: os.rmdir(newdir)
Guido van Rossumca956e22001-03-02 05:46:17 +000030 except os.error: pass
Fred Drake0aaed272000-10-23 13:39:15 +000031 try: os.rmdir(curdir)
Guido van Rossumca956e22001-03-02 05:46:17 +000032 except os.error: pass
Fred Drake0aaed272000-10-23 13:39:15 +000033 try: os.rmdir(test_support.TESTFN)
Guido van Rossumca956e22001-03-02 05:46:17 +000034 except os.error: pass