()
| 31 | |
| 32 | |
| 33 | def test_echo_stdin_stream(): |
| 34 | @click.command() |
| 35 | def test(): |
| 36 | i = click.get_binary_stream("stdin") |
| 37 | o = click.get_binary_stream("stdout") |
| 38 | while True: |
| 39 | chunk = i.read(4096) |
| 40 | if not chunk: |
| 41 | break |
| 42 | o.write(chunk) |
| 43 | o.flush() |
| 44 | |
| 45 | runner = CliRunner(echo_stdin=True) |
| 46 | result = runner.invoke(test, input="Hello World!\n") |
| 47 | assert not result.exception |
| 48 | assert result.output == "Hello World!\nHello World!\n" |
| 49 | |
| 50 | |
| 51 | def test_echo_stdin_prompts(): |