:mod:`expliot.core.ui.cli` ========================== .. py:module:: expliot.core.ui.cli Package Contents ---------------- .. py:class:: TestSuite(pkgname='expliot.plugins') Bases: :class:`dict` TestSuite class inherits from dict and stores all the test cases from plugins package name specified in __init__() .. attribute:: testcls .. method:: import_plugins(self, pkgname) Imports all tests from the specified Package into a dict :param pkgname: The package to load all test case plugins from :return: void .. py:class:: Cli(prompt=None, intro=None) Bases: :class:`cmd2.Cmd` Cli - 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 .. attribute:: do_exit .. method:: del_defaultcmds(self) Delete/remove the default commands from cmd2 which are not required for expliot :return: .. method:: do_list(self, args) List the available test cases .. method:: do_run(self, arglist) Execute a specific plugin/test case :param arglist: Argument list (array) passed from the console :return: .. method:: complete_run(self, 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 :param text: run subcommand string specified by the user :param line: The whole run command string typed by the user :param start_index: Start index subcommand in the line :param end_index: End index of the subcommand in the line :return: List of matching subcommands(plugins) .. method:: runtest(self, name, arglist) Runs a single test case from the TestSuite if it exists :param name: Name of the test case to run :param arglist: Argument list to be passed to the test for parsing :return: void