expliot.core.ui.cli¶
Command-line and console feature for EXPLIoT.
Classes¶
Test Suite class inherits from dict. |
|
The main command line interpreter for EXPLIoT console. |
Package Contents¶
- class expliot.core.ui.cli.TestSuite(pkgname='expliot.plugins')¶
Bases:
dictTest Suite class inherits from dict.
All the test cases from the plugins package name specified in __init__() are stored.
- testcls¶
- import_plugins(pkgname)¶
Import all tests from the specified package into a dict.
- Parameters:
pkgname – The package to load all test case plugins from
- Returns:
- class expliot.core.ui.cli.Cli(prompt=None, intro=None)¶
Bases:
cmd2.CmdThe main command line interpreter for EXPLIoT console.
It inherits Cmd2 package for commandline functionality and adds EXPLIoT specific commands. It also initializes the plugins for execution.
Current EXPLIoT commands defined are:
list: To list available plugins (test cases)
run: Execute a specific plugin (test case)
exit: An alias for Cmd2 quit command
- prompt = None¶
- intro = None¶
- commentGrammars¶
- redirector = '\x01'¶
- allow_redirection = False¶
- locals_in_py = False¶
- tsuite¶
- subcmds¶
- runp¶
- del_defaultcmds()¶
Delete/remove the default commands from cmd2.
- Args:
None
- Returns:
Nothing
- do_list(args)¶
List the available plugins (test cases).
- do_run(arglist)¶
Execute a specific plugin (test case). For details: ef> run -h.
- complete_run(text, line, start_index, end_index)¶
Tab completion method for run command.
It shows the list of available plugins that match the subcommand specified by the user.
- Args:
text (str): Run subcommand string specified by the user line (str): The whole run command string typed by the user start_index (int): Start index subcommand in the line end_index (int): End index of the subcommand in the line
- Returns:
List of matching subcommands(plugins)
- runtest(name, arglist)¶
Run a single test case from the TestSuite if it exists.
- Args:
name (str): Name of the plugin (test case) to run arglist (list): Argument list to be passed to the plugin for parsing
- Returns:
Nothing