This commit includes the following changes: 1. Move all the functionality for listing supported command and displaying their summary to the 'help' subcommand. 2. Simplified the root cli so that it doesn't need to execute all of the subcommand to gather their summary. This is only done on demand now. 3. Changed tox so that flake8 is run using the verbose flag.
22 lines
577 B
Python
22 lines
577 B
Python
from dcos.api import options
|
|
|
|
|
|
def test_extend_usage_docopt():
|
|
command_summaries = [
|
|
('first', 'first summary'),
|
|
('second', ' second summary '),
|
|
('third', 'third summary\n')
|
|
]
|
|
|
|
expected = """
|
|
\tfirst \tfirst summary
|
|
\tsecond \tsecond summary
|
|
\tthird \tthird summary"""
|
|
|
|
assert options.make_command_summary_string(command_summaries) == expected
|
|
|
|
|
|
def test_make_generic_usage_message():
|
|
assert (options.make_generic_usage_message('some generic message') ==
|
|
'Unknown option\nsome generic message')
|