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

Function test_stdsim_pause_storage

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

Source from the content-addressed store, hash-verified

137
138
139def test_stdsim_pause_storage(stdout_sim) -> None:
140 # Test pausing storage for string data
141 my_str = "Hello World"
142
143 stdout_sim.pause_storage = False
144 stdout_sim.write(my_str)
145 assert stdout_sim.read() == my_str
146
147 stdout_sim.pause_storage = True
148 stdout_sim.write(my_str)
149 assert stdout_sim.read() == ""
150
151 # Test pausing storage for binary data
152 b_str = b"Hello World"
153
154 stdout_sim.pause_storage = False
155 stdout_sim.buffer.write(b_str)
156 assert stdout_sim.readbytes() == b_str
157
158 stdout_sim.pause_storage = True
159 stdout_sim.buffer.write(b_str)
160 assert stdout_sim.getbytes() == b""
161
162
163def test_stdsim_line_buffering(base_app) -> None:

Callers

nothing calls this directly

Calls 4

readMethod · 0.80
readbytesMethod · 0.80
getbytesMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…