summaryrefslogtreecommitdiff
path: root/tests/test_cmd2.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2020-11-11 21:17:23 -0500
committerGitHub <noreply@github.com>2020-11-11 21:17:23 -0500
commitaac467e6eb2557b15170919446b2d9cc8fffabdc (patch)
tree60a304ac442574202ff08406cf0a432afe2e393e /tests/test_cmd2.py
parent887bda494c53d6f7457bb70fbbd20b5daf09125f (diff)
parent86d0e9c788ae88738e37242ad8d4c1047b443266 (diff)
downloadcmd2-git-aac467e6eb2557b15170919446b2d9cc8fffabdc.tar.gz
Merge pull request #1007 from bambu/docstr_fmt
Format multiline doc strings to match style of other help messages
Diffstat (limited to 'tests/test_cmd2.py')
-rwxr-xr-xtests/test_cmd2.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index 034f7096..554f2ba7 100755
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -981,6 +981,16 @@ class HelpApp(cmd2.Cmd):
def do_undoc(self, arg):
pass
+ def do_multiline_docstr(self, arg):
+ """
+ This documentation
+ is multiple lines
+ and there are no
+ tabs
+ """
+ pass
+
+
@pytest.fixture
def help_app():
app = HelpApp()
@@ -1004,6 +1014,11 @@ def test_help_overridden_method(help_app):
expected = normalize('This overrides the edit command and does nothing.')
assert out == expected
+def test_help_multiline_docstring(help_app):
+ out, err = run_cmd(help_app, 'help multiline_docstr')
+ expected = normalize('This documentation\nis multiple lines\nand there are no\ntabs')
+ assert out == expected
+
class HelpCategoriesApp(cmd2.Cmd):
"""Class for testing custom help_* methods which override docstring help."""