escape_test.py 文件源码

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

项目:get_started_with_respeaker 作者: respeaker 项目源码 文件源码
def test_xhtml_escape(self):
        tests = [
            ("<foo>", "&lt;foo&gt;"),
            (u("<foo>"), u("&lt;foo&gt;")),
            (b"<foo>", b"&lt;foo&gt;"),

            ("<>&\"", "&lt;&gt;&amp;&quot;"),
            ("&amp;", "&amp;amp;"),
        ]
        for unescaped, escaped in tests:
            self.assertEqual(utf8(xhtml_escape(unescaped)), utf8(escaped))
            self.assertEqual(utf8(unescaped), utf8(xhtml_unescape(escaped)))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号