(buf)
| 163 | |
| 164 | |
| 165 | def test_readuntil(buf): |
| 166 | p = buf.readuntil(b'\n', 4) |
| 167 | next(p) |
| 168 | p.send(b'123') |
| 169 | try: |
| 170 | p.send(b'\n456') |
| 171 | except StopIteration as exc: |
| 172 | res = exc.value |
| 173 | |
| 174 | assert res == b'123\n' |
| 175 | assert b'456' == bytes(buf) |
| 176 | |
| 177 | |
| 178 | def test_readuntil_exc(buf): |