summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorunparalleled-js <yingthi@live.com>2021-12-23 18:37:29 -0600
committerDavid Lord <davidism@gmail.com>2022-02-21 12:18:46 -0800
commit4f7b255f70a4954077f282090e7059b8b7ead42d (patch)
treeb355b72c339f07b35ce5d357cb4f629f014dd5f6 /tests
parentc01e2b8ed17d3ea65981bc62784363d0e38e3092 (diff)
downloadclick-4f7b255f70a4954077f282090e7059b8b7ead42d.tar.gz
allow empty str input for prompt
Diffstat (limited to 'tests')
-rw-r--r--tests/test_termui.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/tests/test_termui.py b/tests/test_termui.py
index 5e819df..3123252 100644
--- a/tests/test_termui.py
+++ b/tests/test_termui.py
@@ -420,17 +420,22 @@ def test_prompt_required_false(runner, args, expect):
@pytest.mark.parametrize(
- ("prompt", "input", "expect"),
+ ("prompt", "input", "default", "expect"),
[
- (True, "password\npassword", "password"),
- ("Confirm Password", "password\npassword\n", "password"),
- (False, None, None),
+ (True, "password\npassword", None, "password"),
+ ("Confirm Password", "password\npassword\n", None, "password"),
+ (True, "", "", ""),
+ (False, None, None, None),
],
)
-def test_confirmation_prompt(runner, prompt, input, expect):
+def test_confirmation_prompt(runner, prompt, input, default, expect):
@click.command()
@click.option(
- "--password", prompt=prompt, hide_input=True, confirmation_prompt=prompt
+ "--password",
+ prompt=prompt,
+ hide_input=True,
+ default=default,
+ confirmation_prompt=prompt,
)
def cli(password):
return password