(buf)
| 99 | |
| 100 | |
| 101 | def test_wait(buf): |
| 102 | p = buf.wait(3) |
| 103 | next(p) |
| 104 | p.send(b'1') |
| 105 | try: |
| 106 | p.send(b'234') |
| 107 | except StopIteration as exc: |
| 108 | res = exc.value |
| 109 | |
| 110 | assert res == b'123' |
| 111 | assert b'1234' == bytes(buf) |
| 112 | |
| 113 | |
| 114 | def test_wait_exc(buf): |