diff options
author | Oleksandr Shulgin <oleksandr.shulgin@zalando.de> | 2015-10-30 16:36:46 +0100 |
---|---|---|
committer | Zachery Bir <zbir@zacbir.net> | 2018-05-15 13:32:03 -0400 |
commit | 37233e2564f6fd921660222431851e8196552b33 (patch) | |
tree | ee1fc77ee8758d08b1fab03403a7a318e31e57fb /tests | |
parent | 895bb96e779d5c8683c9d116713317c80f40762c (diff) | |
download | click-37233e2564f6fd921660222431851e8196552b33.tar.gz |
Use formatter width and max command name width to autotrim short help before display.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_commands.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/tests/test_commands.py b/tests/test_commands.py index ee6006b..9189eca 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -59,18 +59,12 @@ def test_auto_shorthelp(runner): """This is a long text that is too long to show as short help and will be truncated instead.""" - @cli.command(context_settings={'short_help_width': 20}) - def width(): - """This is a long text that is too long to show as short help - and will be truncated instead.""" - result = runner.invoke(cli, ['--help']) assert re.search( r'Commands:\n\s+' - r'long\s+This is a long text that is too long to show\.\.\.\n\s+' + r'long\s+This is a long text that is too long to show as short help\.\.\.\n\s+' r'short\s+This is a short text\.\n\s+' - r'special-chars\s+Login and store the token in ~/.netrc\.\s+' - r'width\s+This is a long text\.\.\.\n\s*', + r'special-chars\s+Login and store the token in ~/.netrc\.\s*', result.output) is not None |