MCPcopy
hub / github.com/tornadoweb/tornado / test_url_unescape_unicode

Method test_url_unescape_unicode

tornado/test/escape_test.py:258–269  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

256 self.assertEqual(url_escape(unescaped), escaped)
257
258 def test_url_unescape_unicode(self):
259 tests = [
260 ("%C3%A9", "\u00e9", "utf8"),
261 ("%C3%A9", "\u00c3\u00a9", "latin1"),
262 ("%C3%A9", utf8("\u00e9"), None),
263 ]
264 for escaped, unescaped, encoding in tests:
265 # input strings to url_unescape should only contain ascii
266 # characters, but make sure the function accepts both byte
267 # and unicode strings.
268 self.assertEqual(url_unescape(to_unicode(escaped), encoding), unescaped)
269 self.assertEqual(url_unescape(utf8(escaped), encoding), unescaped)
270
271 def test_url_escape_quote_plus(self):
272 unescaped = "+ #%"

Callers

nothing calls this directly

Calls 3

utf8Function · 0.90
url_unescapeFunction · 0.90
to_unicodeFunction · 0.90

Tested by

no test coverage detected