summaryrefslogtreecommitdiff
path: root/tests/test_commands.py
diff options
context:
space:
mode:
authorFletcher Davis <fletcher.t.davis@gmail.com>2018-05-15 06:48:00 -0700
committerFletcher Davis <fletcher.t.davis@gmail.com>2018-05-15 06:48:00 -0700
commit639daa4f43da2aa152c415a1bba35fa48aa87259 (patch)
treeb8efc45835a463873d0aee46fae8f9cc5b921821 /tests/test_commands.py
parent1782e21d7b6dc50db522e329dcaf61b9c3a30af1 (diff)
downloadclick-639daa4f43da2aa152c415a1bba35fa48aa87259.tar.gz
allow specify short width to address cmd formatting
try to address the too short short_help width as requested in https://github.com/pallets/click/issues/936
Diffstat (limited to 'tests/test_commands.py')
-rw-r--r--tests/test_commands.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/test_commands.py b/tests/test_commands.py
index e8a9535..af58e7a 100644
--- a/tests/test_commands.py
+++ b/tests/test_commands.py
@@ -59,12 +59,18 @@ 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'short\s+This is a short text\.\n\s+'
- r'special-chars\s+Login and store the token in ~/.netrc\.\s*',
+ r'special-chars\s+Login and store the token in ~/.netrc\.\s+'
+ r'width\s+This is a long text\.\.\.\n\s*',
result.output) is not None