| 112 | |
| 113 | |
| 114 | def test_prompts(): |
| 115 | @click.command() |
| 116 | @click.option("--foo", prompt=True) |
| 117 | def test(foo): |
| 118 | click.echo(f"foo={foo}") |
| 119 | |
| 120 | runner = CliRunner() |
| 121 | result = runner.invoke(test, input="wau wau\n") |
| 122 | assert not result.exception |
| 123 | assert result.output == "Foo: wau wau\nfoo=wau wau\n" |
| 124 | |
| 125 | @click.command() |
| 126 | @click.option("--foo", prompt=True, hide_input=True) |
| 127 | def test(foo): |
| 128 | click.echo(f"foo={foo}") |
| 129 | |
| 130 | runner = CliRunner() |
| 131 | result = runner.invoke(test, input="wau wau\n") |
| 132 | assert not result.exception |
| 133 | assert result.output == "Foo: \nfoo=wau wau\n" |
| 134 | |
| 135 | |
| 136 | def test_getchar(): |