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


Python MIMEAudio.MIMEAudio方法代码示例

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


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

示例1: test_mangle_from_in_preamble_and_epilog

# 需要导入模块: from email import MIMEAudio [as 别名]
# 或者: from email.MIMEAudio import MIMEAudio [as 别名]
def test_mangle_from_in_preamble_and_epilog(self):
        s = StringIO()
        g = Generator(s, mangle_from_=True)
        msg = email.message_from_string(textwrap.dedent("""\
            From: [email protected]
            Mime-Version: 1.0
            Content-Type: multipart/mixed; boundary=XXX

            From somewhere unknown

            --XXX
            Content-Type: text/plain

            foo

            --XXX--

            From somewhere unknowable
            """))
        g.flatten(msg)
        self.assertEqual(len([1 for x in s.getvalue().split('\n')
                                  if x.startswith('>From ')]), 2)


# Test the basic MIMEAudio class 
开发者ID:adde88,项目名称:hostapd-mana,代码行数:27,代码来源:test_email.py

示例2: test__all__

# 需要导入模块: from email import MIMEAudio [as 别名]
# 或者: from email.MIMEAudio import MIMEAudio [as 别名]
def test__all__(self):
        module = __import__('email')
        all = module.__all__
        all.sort()
        self.assertEqual(all, [
            # Old names
            'Charset', 'Encoders', 'Errors', 'Generator',
            'Header', 'Iterators', 'MIMEAudio', 'MIMEBase',
            'MIMEImage', 'MIMEMessage', 'MIMEMultipart',
            'MIMENonMultipart', 'MIMEText', 'Message',
            'Parser', 'Utils', 'base64MIME',
            # new names
            'base64mime', 'charset', 'encoders', 'errors', 'generator',
            'header', 'iterators', 'message', 'message_from_file',
            'message_from_string', 'mime', 'parser',
            'quopriMIME', 'quoprimime', 'utils',
            ]) 
开发者ID:adde88,项目名称:hostapd-mana,代码行数:19,代码来源:test_email.py

示例3: test_dont_mangle_from

# 需要导入模块: from email import MIMEAudio [as 别名]
# 或者: from email.MIMEAudio import MIMEAudio [as 别名]
def test_dont_mangle_from(self):
        s = StringIO()
        g = Generator(s, mangle_from_=False)
        g.flatten(self.msg)
        self.assertEqual(s.getvalue(), """\
From: [email protected]

From the desk of A.A.A.:
Blah blah blah
""")



# Test the basic MIMEAudio class 
开发者ID:sugarguo,项目名称:Flask_Blog,代码行数:16,代码来源:test_email.py

示例4: setUp

# 需要导入模块: from email import MIMEAudio [as 别名]
# 或者: from email.MIMEAudio import MIMEAudio [as 别名]
def setUp(self):
        # Make sure we pick up the audiotest.au that lives in email/test/data.
        # In Python, there's an audiotest.au living in Lib/test but that isn't
        # included in some binary distros that don't include the test
        # package.  The trailing empty string on the .join() is significant
        # since findfile() will do a dirname().
        datadir = os.path.join(os.path.dirname(landmark), 'data', '')
        fp = open(findfile('audiotest.au', datadir), 'rb')
        try:
            self._audiodata = fp.read()
        finally:
            fp.close()
        self._au = MIMEAudio(self._audiodata) 
开发者ID:sugarguo,项目名称:Flask_Blog,代码行数:15,代码来源:test_email.py

示例5: test_checkSetMinor

# 需要导入模块: from email import MIMEAudio [as 别名]
# 或者: from email.MIMEAudio import MIMEAudio [as 别名]
def test_checkSetMinor(self):
        au = MIMEAudio(self._audiodata, 'fish')
        self.assertEqual(au.get_content_type(), 'audio/fish') 
开发者ID:sugarguo,项目名称:Flask_Blog,代码行数:5,代码来源:test_email.py


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