diff options
author | Joachim Jablon <ewjoachim@gmail.com> | 2020-05-10 00:53:26 +0200 |
---|---|---|
committer | David Lord <davidism@gmail.com> | 2020-10-11 18:43:30 -0700 |
commit | 54102a439da9da4a2c84cd893b12020865b9afd3 (patch) | |
tree | b3b18b088bc1cf2ca4d83c0d60cd5972a8b03d34 /tests | |
parent | c067af761a70a6cbb91fa49083a41511207297da (diff) | |
download | click-54102a439da9da4a2c84cd893b12020865b9afd3.tar.gz |
show_default uses default_map
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_options.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_options.py b/tests/test_options.py index 2e50594..eea68c1 100644 --- a/tests/test_options.py +++ b/tests/test_options.py @@ -188,6 +188,18 @@ def test_multiple_default_help(runner): assert "1, 2" in result.output +def test_show_default_default_map(runner): + @click.command() + @click.option("--arg", default="a", show_default=True) + def cmd(arg): + click.echo(arg) + + result = runner.invoke(cmd, ["--help"], default_map={"arg": "b"}) + + assert not result.exception + assert "[default: b]" in result.output + + def test_multiple_default_type(): opt = click.Option(["-a"], multiple=True, default=(1, 2)) assert opt.nargs == 1 |