def test_get_command(self): ClientConfig().load('/etc/yumtools.conf') self.assertTrue( isinstance(commands.getCommand("help"), helpcommand.HelpCommand)) self.assertTrue( isinstance( commands.getCommand("upload"), uploadcommand.UploadCommand))
def test_get_command(self): ClientConfig().load('/etc/yumtools.conf') self.assertTrue( isinstance(commands.getCommand("help"), helpcommand.HelpCommand)) self.assertTrue( isinstance(commands.getCommand("upload"), uploadcommand.UploadCommand))
def run(self, options, args): if not self._checkArgs(args): return error.ERROR_COMMAND_PARM_INVALID command = getCommand(args[0]) if command is None: io.error('', 'command %s not supported.' % args[0]) return error.ERROR_UNSUPPORT_COMMAND command.showHelp() return error.ERROR_SUCCEED