Skip to content

Commit 714390a

Browse files
committed
Write test for expected behavior
1 parent 6cc808d commit 714390a

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
Description:
3+
The foo bar command
4+
5+
Usage:
6+
foo bar [options]
7+
afoobar
8+
9+
Options:
10+
-h, --help Display help for the given command. When no command is given display help for the list command.
11+
-q, --quiet Do not output any message.
12+
-V, --version Display this application version.
13+
--ansi Force ANSI output.
14+
--no-ansi Disable ANSI output.
15+
-n, --no-interaction Do not ask any interactive question.
16+
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug.

tests/test_application.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,21 @@ def test_silent_help(app: Application) -> None:
118118
assert tester.io.fetch_output() == ""
119119

120120

121+
def test_help_multiple_word_command(app: Application) -> None:
122+
app.catch_exceptions(False)
123+
124+
foo = FooCommand()
125+
app.add(foo)
126+
127+
tester = ApplicationTester(app)
128+
tester.execute("help foo bar")
129+
130+
assert (
131+
tester.io.fetch_output()
132+
== FIXTURES_PATH.joinpath("application_help_multiple_word.txt").read_text()
133+
)
134+
135+
121136
def test_get_namespaces(app: Application) -> None:
122137
app.add(FooCommand())
123138
app.add(Foo1Command())

0 commit comments

Comments
 (0)