:py:mod:`expliot.core.ui.cli` ============================= .. py:module:: expliot.core.ui.cli .. autoapi-nested-parse:: Command-line and console feature for EXPLIoT. Package Contents ---------------- Classes ~~~~~~~ .. autoapisummary:: expliot.core.ui.cli.TestSuite expliot.core.ui.cli.Cli .. py:class:: TestSuite(pkgname='expliot.plugins') Bases: :py:obj:`dict` Test Suite class inherits from dict and stores all the test cases from plugins package name specified in __init__(). .. py:attribute:: testcls .. py:method:: import_plugins(pkgname) Import all tests from the specified package into a dict. :param pkgname: The package to load all test case plugins from :return: .. py:class:: Cli(prompt=None, intro=None) Bases: :py:obj:`cmd2.Cmd` The 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: 1. list: To list available plugins (test cases) 2. run: Execute a specific plugin (test case) 3. exit: An alias for Cmd2 quit command .. py:attribute:: do_exit .. py:method:: del_defaultcmds() Delete/remove the default commands from cmd2. Args: None Returns: Nothing .. py:method:: do_list(args) List the available plugins (test cases) .. py:method:: do_run(arglist) Execute a specific plugin (test case). For details: ef> run -h .. py:method:: 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) .. py:method:: 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