本文整理匯總了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