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

Method test_utf8_logging

python/python3/tornado/test/log_test.py:94–105  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

92 self.assertEqual(self.get_output(), utf8(repr(b"\xe9")))
93
94 def test_utf8_logging(self):
95 with ignore_bytes_warning():
96 self.logger.error(u"\u00e9".encode("utf8"))
97 if issubclass(bytes, basestring_type):
98 # on python 2, utf8 byte strings (and by extension ascii byte
99 # strings) are passed through as-is.
100 self.assertEqual(self.get_output(), utf8(u"\u00e9"))
101 else:
102 # on python 3, byte strings always get repr'd even if
103 # they're ascii-only, so this degenerates into another
104 # copy of test_bytes_logging.
105 self.assertEqual(self.get_output(), utf8(repr(utf8(u"\u00e9"))))
106
107 def test_bytes_exception_logging(self):
108 try:

Callers

nothing calls this directly

Calls 4

get_outputMethod · 0.95
utf8Function · 0.90
ignore_bytes_warningFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected