test_pyexpat.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:oil 作者: oilshell 项目源码 文件源码
def test_parse_again(self):
        parser = expat.ParserCreate()
        file = StringIO.StringIO(data)
        parser.ParseFile(file)
        # Issue 6676: ensure a meaningful exception is raised when attempting
        # to parse more than one XML document per xmlparser instance,
        # a limitation of the Expat library.
        with self.assertRaises(expat.error) as cm:
            parser.ParseFile(file)
        self.assertEqual(expat.ErrorString(cm.exception.code),
                          expat.errors.XML_ERROR_FINISHED)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号