MCPcopy Create free account
hub / github.com/EasyIME/PIME / test_xhtml_escape

Method test_xhtml_escape

python/python3/tornado/test/escape_test.py:218–230  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

216 self.assertEqual(linked, html)
217
218 def test_xhtml_escape(self):
219 tests = [
220 ("<foo>", "&lt;foo&gt;"),
221 (u"<foo>", u"&lt;foo&gt;"),
222 (b"<foo>", b"&lt;foo&gt;"),
223 ("<>&\"&#x27;", "&lt;&gt;&amp;&quot;&#39;"),
224 ("&amp;", "&amp;amp;"),
225 (u"<\u00e9>", u"&lt;\u00e9&gt;"),
226 (b"<\xc3\xa9>", b"&lt;\xc3\xa9&gt;"),
227 ] # type: List[Tuple[Union[str, bytes], Union[str, bytes]]]
228 for unescaped, escaped in tests:
229 self.assertEqual(utf8(xhtml_escape(unescaped)), utf8(escaped))
230 self.assertEqual(utf8(unescaped), utf8(xhtml_unescape(escaped)))
231
232 def test_xhtml_unescape_numeric(self):
233 tests = [

Callers

nothing calls this directly

Calls 3

utf8Function · 0.90
xhtml_escapeFunction · 0.90
xhtml_unescapeFunction · 0.90

Tested by

no test coverage detected