summaryrefslogtreecommitdiffstats
path: root/Lib/email/test/test_email.py
diff options
context:
space:
mode:
authorR. David Murray <rdmurray@bitdance.com>2010-12-21 18:07:59 (GMT)
committerR. David Murray <rdmurray@bitdance.com>2010-12-21 18:07:59 (GMT)
commit73a559d0c9918671ec0cc86afc8cc831a5dd47cc (patch)
treeb9951e8e7fb34cfde0835d3e6096b0a6b553335c /Lib/email/test/test_email.py
parent92812028f2748a16ddecb64a97851d0d9a74630e (diff)
downloadcpython-73a559d0c9918671ec0cc86afc8cc831a5dd47cc.zip
cpython-73a559d0c9918671ec0cc86afc8cc831a5dd47cc.tar.gz
cpython-73a559d0c9918671ec0cc86afc8cc831a5dd47cc.tar.bz2
Fix the change made for issue 1243654.
Surprisingly, it turns out there was no test that exercised this code path.
Diffstat (limited to 'Lib/email/test/test_email.py')
-rw-r--r--Lib/email/test/test_email.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/email/test/test_email.py b/Lib/email/test/test_email.py
index e5eece2..a54c1a3 100644
--- a/Lib/email/test/test_email.py
+++ b/Lib/email/test/test_email.py
@@ -180,6 +180,17 @@ class TestMessageAPI(TestEmailBase):
self.assertRaises(errors.HeaderParseError,
msg.set_boundary, 'BOUNDARY')
+ def test_make_boundary(self):
+ msg = MIMEMultipart('form-data')
+ # Note that when the boundary gets created is an implementation
+ # detail and might change.
+ self.assertEqual(msg.items()[0][1], 'multipart/form-data')
+ # Trigger creation of boundary
+ msg.as_string()
+ self.assertEqual(msg.items()[0][1][:33],
+ 'multipart/form-data; boundary="==')
+ # XXX: there ought to be tests of the uniqueness of the boundary, too.
+
def test_message_rfc822_only(self):
# Issue 7970: message/rfc822 not in multipart parsed by
# HeaderParser caused an exception when flattened.