Fred Drake | 0aaed27 | 2000-10-23 13:39:15 +0000 | [diff] [blame] | 1 | import mailbox |
| 2 | import os |
| 3 | import test_support |
| 4 | |
Guido van Rossum | 75ebb29 | 2001-04-10 15:01:20 +0000 | [diff] [blame^] | 5 | # cleanup |
| 6 | try: |
| 7 | os.unlink(test_support.TESTFN) |
| 8 | except os.error: |
| 9 | pass |
| 10 | |
Fred Drake | 0aaed27 | 2000-10-23 13:39:15 +0000 | [diff] [blame] | 11 | # create a new maildir mailbox to work with: |
| 12 | curdir = os.path.join(test_support.TESTFN, "cur") |
| 13 | newdir = os.path.join(test_support.TESTFN, "new") |
| 14 | try: |
| 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 | |
| 28 | finally: |
| 29 | try: os.rmdir(newdir) |
Guido van Rossum | ca956e2 | 2001-03-02 05:46:17 +0000 | [diff] [blame] | 30 | except os.error: pass |
Fred Drake | 0aaed27 | 2000-10-23 13:39:15 +0000 | [diff] [blame] | 31 | try: os.rmdir(curdir) |
Guido van Rossum | ca956e2 | 2001-03-02 05:46:17 +0000 | [diff] [blame] | 32 | except os.error: pass |
Fred Drake | 0aaed27 | 2000-10-23 13:39:15 +0000 | [diff] [blame] | 33 | try: os.rmdir(test_support.TESTFN) |
Guido van Rossum | ca956e2 | 2001-03-02 05:46:17 +0000 | [diff] [blame] | 34 | except os.error: pass |