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

Method test_modified_null

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

Source from the content-addressed store, hash-verified

94 self.assert_writes([b"??\n"])
95
96 def test_modified_null(self):
97 # Null characters are logged using "modified UTF-8".
98 self.log.write("\u0000\n")
99 self.assert_writes([b"\xc0\x80\n"])
100 self.log.write("a\u0000\n")
101 self.assert_writes([b"a\xc0\x80\n"])
102 self.log.write("\u0000b\n")
103 self.assert_writes([b"\xc0\x80b\n"])
104 self.log.write("a\u0000b\n")
105 self.assert_writes([b"a\xc0\x80b\n"])
106
107 def test_nonstandard_str(self):
108 # String subclasses are accepted, but they should be converted

Callers

nothing calls this directly

Calls 2

assert_writesMethod · 0.95
writeMethod · 0.45

Tested by

no test coverage detected