本文整理汇总了Python中email.Errors.FirstHeaderLineIsContinuationDefect方法的典型用法代码示例。如果您正苦于以下问题:Python Errors.FirstHeaderLineIsContinuationDefect方法的具体用法?Python Errors.FirstHeaderLineIsContinuationDefect怎么用?Python Errors.FirstHeaderLineIsContinuationDefect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类email.Errors
的用法示例。
在下文中一共展示了Errors.FirstHeaderLineIsContinuationDefect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_first_line_is_continuation_header
# 需要导入模块: from email import Errors [as 别名]
# 或者: from email.Errors import FirstHeaderLineIsContinuationDefect [as 别名]
def test_first_line_is_continuation_header(self):
eq = self.assertEqual
m = ' Line 1\nLine 2\nLine 3'
msg = email.message_from_string(m)
eq(msg.keys(), [])
eq(msg.get_payload(), 'Line 2\nLine 3')
eq(len(msg.defects), 1)
self.assertIsInstance(msg.defects[0],
Errors.FirstHeaderLineIsContinuationDefect)
eq(msg.defects[0].line, ' Line 1\n')
# Test RFC 2047 header encoding and decoding
示例2: test_first_line_is_continuation_header
# 需要导入模块: from email import Errors [as 别名]
# 或者: from email.Errors import FirstHeaderLineIsContinuationDefect [as 别名]
def test_first_line_is_continuation_header(self):
eq = self.assertEqual
m = ' Line 1\nLine 2\nLine 3'
msg = email.message_from_string(m)
eq(msg.keys(), [])
eq(msg.get_payload(), 'Line 2\nLine 3')
eq(len(msg.defects), 1)
self.assertTrue(isinstance(msg.defects[0],
Errors.FirstHeaderLineIsContinuationDefect))
eq(msg.defects[0].line, ' Line 1\n')
# Test RFC 2047 header encoding and decoding