(buf)
| 206 | |
| 207 | |
| 208 | def test_waituntil(buf): |
| 209 | p = buf.waituntil(b'\n', 4) |
| 210 | next(p) |
| 211 | p.send(b'123') |
| 212 | try: |
| 213 | p.send(b'\n456') |
| 214 | except StopIteration as exc: |
| 215 | res = exc.value |
| 216 | |
| 217 | assert res == b'123\n' |
| 218 | assert b'123\n456' == bytes(buf) |
| 219 | |
| 220 | |
| 221 | def test_waituntil_exc(buf): |