def test_add_header(self):
eq = self.assertEqual
self._im.add_header('Content-Disposition', 'attachment',
filename='dingusfish.gif')
eq(self._im['content-disposition'],
'attachment; filename="dingusfish.gif"')
eq(self._im.get_params(header='content-disposition'),
[('attachment', ''), ('filename', 'dingusfish.gif')])
eq(self._im.get_param('filename', header='content-disposition'),
'dingusfish.gif')
missing = []
eq(self._im.get_param('attachment', header='content-disposition'), '')
self.assertIs(self._im.get_param('foo', failobj=missing,
header='content-disposition'),
missing)
# Try some missing stuff
self.assertIs(self._im.get_param('foobar', missing), missing)
self.assertIs(self._im.get_param('attachment', missing,
header='foobar'), missing)
# Test the basic MIMEApplication class
test_email_renamed.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录