summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_email.py
Commit message (Collapse)AuthorAgeFilesLines
* Make sure the email test suite can be run both stand-alone and underGuido van Rossum2002-10-061-2/+4
| | | | supervision of regrtest.py. Will backport to 2.2.2.
* Shut the test up and add a missing importBarry Warsaw2002-07-191-1/+2
|
* The email package's tests live much better in a subpackageBarry Warsaw2002-07-191-1983/+2
| | | | | | | | | | | | (i.e. email.test), so move the guts of them here from Lib/test. The latter directory will retain stubs to run the email.test tests using Python's standard regression test. test_email_torture.py is a torture tester which will not run under Python's test suite because I don't want to commit megs of data to that project (it will fail cleanly there). When run under the mimelib project it'll stress test the package with megs of message samples collected from various locations in the wild.
* ndiffAssertEqual(): Stringify the arguments before runningBarry Warsaw2002-07-091-4/+16
| | | | | | | .splitlines() on them, since they may be Header instances. test_multilingual(), test_header_ctor_default_args(): New tests of make_header() and that Header can take all default arguments.
* TestEmailBase.ndiffAssertEqual(): Python 2.1's difflib doesn't have anBarry Warsaw2002-07-091-32/+186
| | | | | | | | | | ndiff function, so just alias it to assertEqual in that case. Various: make sure all openfile()/read()'s are wrapped in try/finally's so the file gets closed. A bunch of new tests checking the corner cases for multipart/digest and message/rfc822.
* Another test of long headers.Barry Warsaw2002-06-291-0/+4
|
* Oleg Broytmann's support for RFC 2231 encoded parameters, SF patch #549133Barry Warsaw2002-06-291-1/+12
| | | | New test cases.
* test_multilingual(): Test for Header.__unicode__().Barry Warsaw2002-06-291-0/+22
|
* Lots of new and updated tests to check for proper ascii headerBarry Warsaw2002-06-281-37/+167
| | | | | | | folding. Note that some of the Japanese tests have changed, but I don't really know if they are correct or not. :( Someone with Japanese and RFC 2047 expertise, please take a look!
* Generator.__call__() => Generator.flatten()Barry Warsaw2002-06-021-28/+56
| | | | Also, adjust to the new message/rfc822 tree layout.
* getaddresses(): Like the change in rfc822.py, this one needs to accessBarry Warsaw2002-05-221-0/+7
| | | | | | the AddressList.addresslist attribute directly. Also, add a test case for the email.Utils.getaddresses() interface.
* Add two new tests of recent email package fixes: CRLF line endings,Barry Warsaw2002-05-191-0/+26
| | | | and explicit maxlinelen arguments to the Header constructor.
* There was a non-ascii character in the source. Replaced by a hex escape.Jack Jansen2002-04-231-1/+1
|
* Whitespace normalization, while using non-whitespace literals forBarry Warsaw2002-04-161-26/+26
| | | | intended whitespace.
* Apparently 3 of the tests here rely on trailing whitespace and/or hardTim Peters2002-04-161-26/+26
| | | | | tab characters, so reverting the whitespace normalization. Barry, please repair this.
* Whitespace normalization.Tim Peters2002-04-161-26/+26
|
* test_main(): Added this so the test can actually get run under theBarry Warsaw2002-04-151-19/+14
| | | | | regrtest framework. Keep the original standalone-unittest scaffolding (i.e. suite() and __main__).
* Sync'ing with standalone email package 2.0.1. This adds support forBarry Warsaw2002-04-101-48/+594
| | | | | | | | | non-us-ascii character sets in headers and bodies. Some API changes (with DeprecationWarnings for the old APIs). Better RFC-compliant implementations of base64 and quoted-printable. Updated test cases. Documentation updates to follow (after I finish writing them ;).
* test_multipart_one_part(): Idempotency test case for a multipart/*Barry Warsaw2002-01-271-1/+5
| | | | with only one subpart.
* test_parseaddr_empty(): New test for assuring thatBarry Warsaw2001-12-201-0/+4
| | | | | Utils.parseaddr('<>') -- i.e. on an empty address, returns the empty string. Built on rfc822, this used to return None.
* I found that when run as a script, this test suite ran its testsGuido van Rossum2001-12-071-6/+6
| | | | | | twice! Fixed this by avoiding the import of test_email, which loads the module a second time in that situation, and fiddled the __main__ section to resemble other test suites using unittest.
* test_formatdate(): Integrating Jack's 22b2 branch fix for Mac epoch:Barry Warsaw2001-11-271-3/+4
| | | | | | | | More changes to the formatdate epoch test: the Mac epoch is in localtime, so east of GMT it falls in 1903:-( Changed the test to obtain the epoch in both local time and GMT, and do the right thing in the comparisons. As a sanity measure also check that day/month is Jan 1.
* test_formatdate(): Remove the unnecessary ldate calculation.Barry Warsaw2001-11-191-3/+6
| | | | | test_formatdate_zoneoffsets() => test_formatdate_localtime(): Do the sign corrected calculation of the zone offset.
* test_formatdate(), test_formatdate_zoneoffsets(): Two changes. First,Barry Warsaw2001-11-191-17/+16
| | | | | | | | | | | use the correct way to test for epoch, by looking at the year component of gmtime(0). Add clause for Unix epoch and Mac epoch (Tim, what is Windows epoch?). Also, get rid of the strptime() test, it was way too problematic given that strptime() is missing on many platforms and issues with locales. Instead, simply test that formatdate() gets the numeric timezone calculation correct for the altzone and timezone.
* test_formatdate(): A test that has a mild hope of working on Mac,Barry Warsaw2001-11-181-1/+11
| | | | | which has a different epoch than *nix. Jack may need to twiddle the details.
* Add tests for bug #478115, parsedate_tz() IndexError when a Date:Barry Warsaw2001-11-131-0/+3
| | | | field exists with an empty value.
* test_formatdate(): Dang. Typo.Barry Warsaw2001-11-091-1/+1
|
* test_formatdate(): Don't do the localtime test if we don't haveBarry Warsaw2001-11-091-10/+12
| | | | strptime() -- I'm too lazy to code it otherwise.
* test_formatdate(): A test for email.Utils.formatdate().Barry Warsaw2001-11-091-0/+16
|
* A fix for SF bug #472560, extra newlines returned by get_param() whenBarry Warsaw2001-10-251-0/+4
| | | | | | | | the separating semi-colon shows up on a continuation line (legal, but weird). Bug reported and fixed by Matthew Cowles. Test case and sample email included.
* Another merge from mimelib:Barry Warsaw2001-10-191-0/+27
| | | | | TestMIMEMessage.test_epilogue(), TestIdempotent.test_preamble_epilogue(): Test cases for SF bug #472481.
* Whitespace normalization.Tim Peters2001-10-181-1/+1
|
* Two merges from the mimelib project:Barry Warsaw2001-10-171-0/+34
| | | | | | | | | test_no_semis_header_splitter(): This actually should still split. test_no_split_long_header(): An example of an unsplittable line. test_no_semis_header_splitter(): Test for SF bug # 471918, Generator splitting long headers.
* test_typed_subpart_iterator_default_type(): Test for when the messageBarry Warsaw2001-10-151-0/+18
| | | | has no Content-Type: header, it should be treated as text/plain.
* Add a test for the HeaderParser class.Barry Warsaw2001-10-111-1/+17
|
* Added tests for MIMEAudio class/moduleBarry Warsaw2001-10-091-4/+69
|
* Add a test for get_all() returning failobj. msg_20.txt is a sampleBarry Warsaw2001-10-091-0/+6
| | | | message with multiple CC: fields, used in the get_all() test.
* TestIterators: Tim Peters suggests a more succinct spelling ofBarry Warsaw2001-10-041-12/+4
| | | | "listify an iterator".
* test_header_splitter(), test_body_line_iterator(): Move the test dataBarry Warsaw2001-10-041-70/+32
| | | | into tests/data/msg_*.txt files.
* This test relied on hard tab characters, so failed after whitespaceTim Peters2001-10-041-5/+5
| | | | normalization. Now uses \t in strings instead of hard tabs.
* Whitespace normalization.Tim Peters2001-10-041-30/+30
|
* Update the tests for the current incarnation of the email package, andBarry Warsaw2001-09-261-105/+198
| | | | added some new tests of message/delivery-status content type messages.
* An extensive test suite for the email package.Barry Warsaw2001-09-231-0/+797