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

Method test_byteslike_in_buffer

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

Source from the content-addressed store, hash-verified

132 self.log.write(obj)
133
134 def test_byteslike_in_buffer(self):
135 # The underlying buffer *can* accept bytes-like objects
136 self.log.buffer.write(bytearray(b"hello"))
137 self.log.flush()
138
139 self.log.buffer.write(b"")
140 self.log.flush()
141
142 self.log.buffer.write(b"goodbye")
143 self.log.flush()
144
145 self.assert_writes([b"hello", b"goodbye"])
146
147 def test_non_byteslike_in_buffer(self):
148 for obj in ["hello", None, 42]:

Callers

nothing calls this directly

Calls 3

assert_writesMethod · 0.95
writeMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected