MCPcopy Index your code
hub / github.com/python/cpython / test_non_ascii

Method test_non_ascii

Lib/test/test_apple.py:79–94  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

77 self.assert_writes([b"Hello again"])
78
79 def test_non_ascii(self):
80 # Spanish
81 self.log.write("ol\u00e9\n")
82 self.assert_writes([b"ol\xc3\xa9\n"])
83
84 # Chinese
85 self.log.write("\u4e2d\u6587\n")
86 self.assert_writes([b"\xe4\xb8\xad\xe6\x96\x87\n"])
87
88 # Printing Non-BMP emoji
89 self.log.write("\U0001f600\n")
90 self.assert_writes([b"\xf0\x9f\x98\x80\n"])
91
92 # Non-encodable surrogates are replaced
93 self.log.write("\ud800\udc00\n")
94 self.assert_writes([b"??\n"])
95
96 def test_modified_null(self):
97 # Null characters are logged using "modified UTF-8".

Callers

nothing calls this directly

Calls 2

assert_writesMethod · 0.95
writeMethod · 0.45

Tested by

no test coverage detected