(stdout_sim)
| 106 | |
| 107 | |
| 108 | def 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 | |
| 118 | def test_stdsim_clear(stdout_sim) -> None: |