summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2003-03-11 04:31:37 (GMT)
committerBarry Warsaw <barry@python.org>2003-03-11 04:31:37 (GMT)
commit3840b49d9c2ae09ae2ccb59e2b1276c74dc3e4df (patch)
tree885430a5de1f9e689cb9de773bfd65fed2baed0a
parent9ac783d723bda15a34218ebb2037b60e521c3248 (diff)
downloadcpython-3840b49d9c2ae09ae2ccb59e2b1276c74dc3e4df.zip
cpython-3840b49d9c2ae09ae2ccb59e2b1276c74dc3e4df.tar.gz
cpython-3840b49d9c2ae09ae2ccb59e2b1276c74dc3e4df.tar.bz2
test_get_decoded_uu_payload(): A new test for
Content-Transfer-Encoding: x-uuencode
-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 317e08a..0b8314e 100644
--- a/Lib/email/test/test_email.py
+++ b/Lib/email/test/test_email.py
@@ -204,6 +204,17 @@ class TestMessageAPI(TestEmailBase):
eq(msg.get_payload(3).get_payload(decode=True),
'This has no Content-Transfer-Encoding: header.\n')
+ def test_get_decoded_uu_payload(self):
+ eq = self.assertEqual
+ msg = Message()
+ msg.set_payload('begin 666 -\n+:&5L;&\\@=V]R;&0 \n \nend\n')
+ for cte in ('x-uuencode', 'uuencode', 'uue', 'x-uue'):
+ msg['content-transfer-encoding'] = cte
+ eq(msg.get_payload(decode=True), 'hello world')
+ # Now try some bogus data
+ msg.set_payload('foo')
+ eq(msg.get_payload(decode=True), 'foo')
+
def test_decoded_generator(self):
eq = self.assertEqual
msg = self._msgobj('msg_07.txt')