当前位置: 首页>>代码示例>>Python>>正文


Python Iterators._structure方法代码示例

本文整理汇总了Python中email.Iterators._structure方法的典型用法代码示例。如果您正苦于以下问题:Python Iterators._structure方法的具体用法?Python Iterators._structure怎么用?Python Iterators._structure使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在email.Iterators的用法示例。


在下文中一共展示了Iterators._structure方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_nested_inner_contains_outer_boundary

# 需要导入模块: from email import Iterators [as 别名]
# 或者: from email.Iterators import _structure [as 别名]
def test_nested_inner_contains_outer_boundary(self):
        eq = self.ndiffAssertEqual
        # msg_38.txt has an inner part that contains outer boundaries.  My
        # interpretation of RFC 2046 (based on sections 5.1 and 5.1.2) say
        # these are illegal and should be interpreted as unterminated inner
        # parts.
        msg = self._msgobj('msg_38.txt')
        sfp = StringIO()
        Iterators._structure(msg, sfp)
        eq(sfp.getvalue(), """\
multipart/mixed
    multipart/mixed
        multipart/alternative
            text/plain
        text/plain
    text/plain
    text/plain
""") 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:20,代码来源:test_email.py

示例2: test_nested_with_same_boundary

# 需要导入模块: from email import Iterators [as 别名]
# 或者: from email.Iterators import _structure [as 别名]
def test_nested_with_same_boundary(self):
        eq = self.ndiffAssertEqual
        # msg 39.txt is similarly evil in that it's got inner parts that use
        # the same boundary as outer parts.  Again, I believe the way this is
        # parsed is closest to the spirit of RFC 2046
        msg = self._msgobj('msg_39.txt')
        sfp = StringIO()
        Iterators._structure(msg, sfp)
        eq(sfp.getvalue(), """\
multipart/mixed
    multipart/mixed
        multipart/alternative
        application/octet-stream
        application/octet-stream
    text/plain
""") 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:18,代码来源:test_email.py

示例3: test_partial_falls_inside_message_delivery_status

# 需要导入模块: from email import Iterators [as 别名]
# 或者: from email.Iterators import _structure [as 别名]
def test_partial_falls_inside_message_delivery_status(self):
        eq = self.ndiffAssertEqual
        # The Parser interface provides chunks of data to FeedParser in 8192
        # byte gulps.  SF bug #1076485 found one of those chunks inside
        # message/delivery-status header block, which triggered an
        # unreadline() of NeedMoreData.
        msg = self._msgobj('msg_43.txt')
        sfp = StringIO()
        Iterators._structure(msg, sfp)
        eq(sfp.getvalue(), """\
multipart/report
    text/plain
    message/delivery-status
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
    text/rfc822-headers
""")



# Test the iterator/generators 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:47,代码来源:test_email.py


注:本文中的email.Iterators._structure方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。