MCPcopy
hub / github.com/pallets/click / test_bytesiocopy_writes_to_both

Function test_bytesiocopy_writes_to_both

tests/test_stream_lifecycle.py:165–172  ·  view source on GitHub ↗

``BytesIOCopy`` writes to itself and to ``copy_to``.

()

Source from the content-addressed store, hash-verified

163
164
165def test_bytesiocopy_writes_to_both():
166 """``BytesIOCopy`` writes to itself and to ``copy_to``."""
167 target = io.BytesIO()
168 copier = BytesIOCopy(copy_to=target)
169 copier.write(b"data")
170 copier.flush()
171 assert copier.getvalue() == b"data"
172 assert target.getvalue() == b"data"
173
174
175def test_bytesiocopy_flush_propagates():

Callers

nothing calls this directly

Calls 4

writeMethod · 0.95
flushMethod · 0.95
BytesIOCopyClass · 0.90
getvalueMethod · 0.80

Tested by

no test coverage detected