Add CLI parsing tests

These test that command lines are parsed to correct Command arguments.
Includes some tests for interactive prompts.

To make this possible cli.run is broken up into several pieces.
This commit is contained in:
Petr Viktorin
2012-03-13 07:10:52 -04:00
committed by Martin Kosek
parent a2299070c8
commit 96c5551ace
4 changed files with 207 additions and 5 deletions

View File

@@ -916,5 +916,8 @@ def create_api(mode='dummy'):
api = create_api(mode=None)
if os.environ.get('IPA_UNIT_TEST_MODE', None) == 'cli_test':
from cli import cli_plugins
for klass in cli_plugins:
api.register(klass)
api.bootstrap(context='cli', in_server=False, in_tree=True)
api.finalize()