summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_mailbox.py
Commit message (Collapse)AuthorAgeFilesLines
* #7627: MH.remove() would fail if the MH mailbox was locked;Andrew M. Kuchling2010-02-221-0/+7
| | | | it would call _unlock_file() and pass it a closed file object. Noted by Rob Austein.
* #7092: silence py3k warnings for deprecated modulesEzio Melotti2010-01-301-1/+2
|
* Reverting the Revision: 77368. I committed Flox's big patch for tests bySenthil Kumaran2010-01-081-2/+1
| | | | mistake. ( It may come in for sure tough)
* Fixing - Issue7026 - RuntimeError: dictionary changed size during iteration. ↵Senthil Kumaran2010-01-081-1/+2
| | | | Patch by flox
* This should finally fix #6896. Let's watch the buildbots.Antoine Pitrou2009-11-011-0/+3
|
* Use richer assertions in test_mailbox (for better failure messages).Antoine Pitrou2009-10-311-373/+373
|
* convert usage of fail* to assert*Benjamin Peterson2009-06-301-350/+350
|
* #1607951: Make mailbox.Maildir re-read the directories less frequently.Andrew M. Kuchling2009-05-021-0/+31
| | | | | This is done by recording the current time -1sec, and not re-reading unless the directory mod. times are >= the recorded time.
* Add missing iteritems() call to the for loop in mailbox.MH.get_message().R. David Murray2009-04-021-0/+6
| | | | Fixes issue2625.
* Bug 3228: take a test from Niels Gustaebel's patch, and based on his patch, ↵Andrew M. Kuchling2008-08-051-6/+29
| | | | check for having os.stat available
* Bug 3228: Explicitly supply the file mode to avoid creating executable files,Andrew M. Kuchling2008-08-041-1/+27
| | | | | and add corresponding tests. Possible 2.5 backport candidate
* #2503 make singletons compared with "is" not == or !=Benjamin Peterson2008-03-291-2/+2
| | | | Thanks to Wummel for the patch
* Ensure that the mailbox is closed to prevent problems on Windows with removingNeal Norwitz2008-03-261-3/+5
| | | | | | an open file. This doesn't seem to be a problem in 2.6, but that appears to be somewhat accidental (specific to reference counting). When this gets merged to 3.0, it will make the 3.0 code simpler.
* Correct test_mailbox on win32: since the test sets a custom 'colon' attributeAmaury Forgeot d'Arc2008-02-031-0/+1
| | | | to the main mailbox, copy it to secondary mailbox instances.
* Bug 1277: make Maildir use the user-provided factory instead of hard-wiring ↵Andrew M. Kuchling2008-01-191-0/+14
| | | | | | MaildirMessage. 2.5.2 bugfix candidate.
* Avoid exception if there's a stray directory inside a Maildir folder.Andrew M. Kuchling2007-07-141-1/+12
| | | | | | | The Maildir specification doesn't seem to say anything about this situation, and it can happen if you're keeping a Maildir mailbox in Subversion (.svn directories) or some similar system. The patch just ignores directories in the cur/, new/, tmp/ folders.
* Try to be a little more resilient to errors. This might help the testNeal Norwitz2007-03-201-2/+2
| | | | | | pass, but my guess is that it won't. I'm guessing that some other test is leaving this file open which means it can't be removed under Windows AFAIK.
* Try to make this test more resistant to dropping from previous runs (ie, ↵Neal Norwitz2007-03-201-0/+1
| | | | files that may exist but cause the test to fail). Should be backported (assuming it works :-)
* Whitespace normalization.Tim Peters2007-01-301-4/+4
|
* Use new email module names (#1637162, #1637159, #1637157).Georg Brandl2007-01-221-8/+8
|
* Remove file-locking in MH.pack() method.Andrew M. Kuchling2006-11-171-0/+15
| | | | | | | | | | | | | | | | | | This change looks massive but it's mostly a re-indenting after removing some try...finally blocks. Also adds a test case that does a pack() while the mailbox is locked; this test would have turned up bugs in the original code on some platforms. In both nmh and GNU Mailutils' implementation of MH-format mailboxes, no locking is done of individual message files when renaming them. The original mailbox.py code did do locking, which meant that message files had to be opened. This code was buggy on certain platforms (found through reading the code); there were code paths that closed the file object and then called _unlock_file() on it. Will backport to 25-maint once I see how the buildbots react to this patch.
* [Bug #1569790] mailbox.Maildir.get_folder() loses factory informationAndrew M. Kuchling2006-11-091-1/+23
| | | | | | | Both the Maildir and MH classes had this bug; the patch fixes both classes and adds a test. Will backport to 25-maint.
* Whitespace normalization.Tim Peters2006-11-031-3/+3
|
* [Bug #1575506] The _singlefileMailbox class was using the wrong file object ↵Andrew M. Kuchling2006-10-271-0/+16
| | | | in its flush() method, causing an error
* Fix the failures on cygwin (2006-08-10 fixed the actual locking issue).Neal Norwitz2006-08-111-5/+8
| | | | | | The first hunk changes the colon to an ! like other Windows variants. We need to always wait on the child so the lock gets released and no other tests fail. This is the try/finally in the second hunk.
* Get mailbox module working on OS/2 EMX port.Andrew MacIntyre2006-07-231-2/+2
|
* Add new utility function, reap_children(), to test_support. This shouldNeal Norwitz2006-06-291-0/+1
| | | | | | | | | | be called at the end of each test that spawns children (perhaps it should be called from regrtest instead?). This will hopefully prevent some of the unexplained failures in the buildbots (hppa and alpha) during tests that spawn children. The problems were not reproducible. There were many zombies that remained at the end of several tests. In the worst case, this shouldn't cause any more problems, though it may not help either. Time will tell.
* Whitespace normalization.Tim Peters2006-06-271-2/+2
|
* Attempt to fix build failure on OS X and Debian alpha; the symptom isAndrew M. Kuchling2006-06-261-1/+1
| | | | | | | | | | consistent with os.wait() returning immediately because some other subprocess had previously exited; the test suite then immediately tries to lock the mailbox and gets an error saying it's already locked. To fix this, do a waitpid() so the test suite only continues once the intended child process has exited.
* Windows doesn't have os.fork(). I'll just disable this test for nowAndrew M. Kuchling2006-06-261-0/+2
|
* Add a test for a conflicting lock.Andrew M. Kuchling2006-06-261-0/+22
| | | | | On slow machines, maybe the time intervals (2 sec, 0.5 sec) will be too tight. I'll see how the buildbots like it.
* Use open() instead of file()Andrew M. Kuchling2006-05-021-3/+3
|
* Hopefully this will fix the spurious failures of test_mailbox.py that I'mGuido van Rossum2006-05-021-4/+8
| | | | | experiencing. (This code and mailbox.py itself are full of calls to file() that should be calls to open() -- but I'm not fixing those.)
* Whitespace normalization.Tim Peters2006-04-221-17/+17
|
* Add Gregory K. Johnson's revised version of mailbox.py (funded byAndrew M. Kuchling2006-04-221-14/+1658
| | | | | | | | | | | | | | | | | the 2005 Summer of Code). The revision adds a number of new mailbox classes that support adding and removing messages; these classes also support mailbox locking and default to using email.Message instead of rfc822.Message. The old mailbox classes are largely left alone for backward compatibility. The exception is the Maildir class, which was present in the old module and now inherits from the new classes. The Maildir class's interface is pretty simple, though, so I think it'll be compatible with existing code. (The change to the NEWS file also adds a missing word to a different news item, which unfortunately required rewrapping the line.)
* added test for bug #996359.Skip Montanaro2004-07-241-3/+18
|
* Get rid of relative imports in all unittests. Now anything thatBarry Warsaw2002-07-231-1/+1
| | | | | | | | | | | imports e.g. test_support must do so using an absolute package name such as "import test.test_support" or "from test import test_support". This also updates the README in Lib/test, and gets rid of the duplicate data dirctory in Lib/test/data (replaced by Lib/email/test/data). Now Tim and Jack can have at it. :)
* SF patch #474590 -- RISC OS supportGuido van Rossum2001-10-241-1/+1
|
* Change the PyUnit-based tests to use the test_main() approach. ThisFred Drake2001-09-201-1/+6
| | | | | allows using the tests with unittest.py as a script. The tests will still run when run as a script themselves.
* The test used int(time.time()) to get a random number, but this doesn't work ↵Jack Jansen2001-06-191-1/+1
| | | | on the mac (where times are bigger than ints). Changed to int(time.time()%1000000).
* create_message(): When os.link() doesn't exist, make a copy of the msgTim Peters2001-05-221-1/+6
| | | | instead. Allows this test to finish on Windows again.
* Re-write the mailbox test suite to use PyUnit. Cover a lot more groundFred Drake2001-05-211-21/+81
| | | | | for the Maildir mailbox format. This still does not address other mailbox formats.
* Some other tests, when failing, don't always remove their TESTFN file.Guido van Rossum2001-04-101-0/+6
| | | | Try to do it for them, so our mkdir() operation doesn't fail.
* When catching errors from os.rmdir(), test for os.error, not IOError!Guido van Rossum2001-03-021-3/+3
|
* Added test for regression on SourceForge bug #117490.Fred Drake2000-10-231-0/+28