MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / test_stdsim_read_bytes

Function test_stdsim_read_bytes

tests/test_utils.py:108–115  ·  view source on GitHub ↗
(stdout_sim)

Source from the content-addressed store, hash-verified

106
107
108def test_stdsim_read_bytes(stdout_sim) -> None:
109 b_str = b"Hello World"
110 stdout_sim.buffer.write(b_str)
111 # getbytes() returns the value and leaves it unaffected internally
112 assert stdout_sim.getbytes() == b_str
113 # read_bytes() returns the value and then clears the internal buffer
114 assert stdout_sim.readbytes() == b_str
115 assert stdout_sim.getbytes() == b""
116
117
118def test_stdsim_clear(stdout_sim) -> None:

Callers

nothing calls this directly

Calls 3

getbytesMethod · 0.80
readbytesMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…