()
| 13 | |
| 14 | |
| 15 | def test_runner(): |
| 16 | @click.command() |
| 17 | def test(): |
| 18 | i = click.get_binary_stream("stdin") |
| 19 | o = click.get_binary_stream("stdout") |
| 20 | while True: |
| 21 | chunk = i.read(4096) |
| 22 | if not chunk: |
| 23 | break |
| 24 | o.write(chunk) |
| 25 | o.flush() |
| 26 | |
| 27 | runner = CliRunner() |
| 28 | result = runner.invoke(test, input="Hello World!\n") |
| 29 | assert not result.exception |
| 30 | assert result.output == "Hello World!\n" |
| 31 | |
| 32 | |
| 33 | def test_echo_stdin_stream(): |