diff options
| author | R David Murray <rdmurray@bitdance.com> | 2013-10-17 02:48:40 (GMT) |
|---|---|---|
| committer | R David Murray <rdmurray@bitdance.com> | 2013-10-17 02:48:40 (GMT) |
| commit | 3da240fd01e02a31e516847ba865a9f56d7cfcbc (patch) | |
| tree | 056628df84b2e949fb793d75235e38766a16fbcc /Lib/test/test_email/test_headerregistry.py | |
| parent | 1a1628819779110854d4e1ab490db2cab80e26b4 (diff) | |
| download | cpython-3da240fd01e02a31e516847ba865a9f56d7cfcbc.zip cpython-3da240fd01e02a31e516847ba865a9f56d7cfcbc.tar.gz cpython-3da240fd01e02a31e516847ba865a9f56d7cfcbc.tar.bz2 | |
#18891: Complete new provisional email API.
This adds EmailMessage and, MIMEPart subclasses of Message
with new API methods, and a ContentManager class used by
the new methods. Also a new policy setting, content_manager.
Patch was reviewed by Stephen J. Turnbull and Serhiy Storchaka,
and reflects their feedback.
I will ideally add some examples of using the new API to the
documentation before the final release.
Diffstat (limited to 'Lib/test/test_email/test_headerregistry.py')
| -rw-r--r-- | Lib/test/test_email/test_headerregistry.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Lib/test/test_email/test_headerregistry.py b/Lib/test/test_email/test_headerregistry.py index f829f83..f2df372 100644 --- a/Lib/test/test_email/test_headerregistry.py +++ b/Lib/test/test_email/test_headerregistry.py @@ -661,7 +661,7 @@ class TestContentTypeHeader(TestHeaderBase): 'text/plain; name="ascii_is_the_default"'), 'rfc2231_bad_character_in_charset_parameter_value': ( - "text/plain; charset*=ascii''utf-8%E2%80%9D", + "text/plain; charset*=ascii''utf-8%F1%F2%F3", 'text/plain', 'text', 'plain', @@ -669,6 +669,18 @@ class TestContentTypeHeader(TestHeaderBase): [errors.UndecodableBytesDefect], 'text/plain; charset="utf-8\uFFFD\uFFFD\uFFFD"'), + 'rfc2231_utf_8_in_supposedly_ascii_charset_parameter_value': ( + "text/plain; charset*=ascii''utf-8%E2%80%9D", + 'text/plain', + 'text', + 'plain', + {'charset': 'utf-8”'}, + [errors.UndecodableBytesDefect], + 'text/plain; charset="utf-8”"', + ), + # XXX: if the above were *re*folded, it would get tagged as utf-8 + # instead of ascii in the param, since it now contains non-ASCII. + 'rfc2231_encoded_then_unencoded_segments': ( ('application/x-foo;' '\tname*0*="us-ascii\'en-us\'My";' |
