diff options
author | R David Murray <rdmurray@bitdance.com> | 2015-05-16 19:41:07 (GMT) |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2015-05-16 19:41:07 (GMT) |
commit | b744f3a45e3228ea2b344c8cf9424e2592dc93b7 (patch) | |
tree | d642d35aa8a2fb02ce9ef8ba8354126d366ff6f0 /Lib/test/test_email | |
parent | b9cec6a30f77c4c0ab208053ffafc02fddd01962 (diff) | |
download | cpython-b744f3a45e3228ea2b344c8cf9424e2592dc93b7.zip cpython-b744f3a45e3228ea2b344c8cf9424e2592dc93b7.tar.gz cpython-b744f3a45e3228ea2b344c8cf9424e2592dc93b7.tar.bz2 |
#21083: add get_content_disposition method to email.message.
Patch by Abhilash Raj.
Diffstat (limited to 'Lib/test/test_email')
-rw-r--r-- | Lib/test/test_email/test_email.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_email/test_email.py b/Lib/test/test_email/test_email.py index 218ce0c..b627760 100644 --- a/Lib/test/test_email/test_email.py +++ b/Lib/test/test_email/test_email.py @@ -586,6 +586,17 @@ class TestMessageAPI(TestEmailBase): eq(msg.values(), ['One Hundred', 'Twenty', 'Three', 'Eleven']) self.assertRaises(KeyError, msg.replace_header, 'Fourth', 'Missing') + def test_get_content_disposition(self): + msg = Message() + self.assertIsNone(msg.get_content_disposition()) + msg.add_header('Content-Disposition', 'attachment', + filename='random.avi') + self.assertEqual(msg.get_content_disposition(), 'attachment') + msg.replace_header('Content-Disposition', 'inline') + self.assertEqual(msg.get_content_disposition(), 'inline') + msg.replace_header('Content-Disposition', 'InlinE') + self.assertEqual(msg.get_content_disposition(), 'inline') + # test_defect_handling:test_invalid_chars_in_base64_payload def test_broken_base64_payload(self): x = 'AwDp0P7//y6LwKEAcPa/6Q=9' |