-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1855 from jemrobinson/1853-add-dsh-help-test
Add test for help function
- Loading branch information
Showing
6 changed files
with
75 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,3 @@ | ||
from .admin import admin_command_group | ||
from .config import config_command_group | ||
from .context import context_command_group | ||
from .deploy import deploy_command_group | ||
from .teardown import teardown_command_group | ||
from .cli import application | ||
|
||
__all__ = [ | ||
"admin_command_group", | ||
"context_command_group", | ||
"config_command_group", | ||
"deploy_command_group", | ||
"teardown_command_group", | ||
] | ||
__all__ = ["application"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from data_safe_haven.commands import application | ||
|
||
|
||
class TestHelp: | ||
def result_checker(self, result): | ||
assert result.exit_code == 0 | ||
assert "Usage: dsh [OPTIONS] COMMAND [ARGS]..." in result.stdout | ||
assert "Arguments to the main executable" in result.stdout | ||
assert "│ --output" in result.stdout | ||
assert "│ --verbosity" in result.stdout | ||
assert "│ --version" in result.stdout | ||
assert "│ --install-completion" in result.stdout | ||
assert "│ --show-completion" in result.stdout | ||
assert "│ --help" in result.stdout | ||
assert "│ admin" in result.stdout | ||
assert "│ config" in result.stdout | ||
assert "│ context" in result.stdout | ||
assert "│ deploy" in result.stdout | ||
assert "│ teardown" in result.stdout | ||
|
||
def test_help(self, runner): | ||
result = runner.invoke(application, ["--help"]) | ||
self.result_checker(result) | ||
|
||
def test_help_short_code(self, runner): | ||
result = runner.invoke(application, ["-h"]) | ||
self.result_checker(result) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters