Fred Drake | 0aaed27 | 2000-10-23 13:39:15 +0000 | [diff] [blame] | 1 | import mailbox |
| 2 | import os |
| 3 | import test_support |
| 4 | |
| 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) |
| 12 | |
| 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" |
| 19 | |
| 20 | # XXX We still need more tests! |
| 21 | |
| 22 | finally: |
| 23 | try: os.rmdir(newdir) |
| 24 | except IOError: pass |
| 25 | try: os.rmdir(curdir) |
| 26 | except IOError: pass |
| 27 | try: os.rmdir(test_support.TESTFN) |
| 28 | except IOError: pass |