From bbfe9b09d2b1ac7bfe286311fef83d36c6125c96 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Tue, 23 Jan 2018 11:19:41 +0100 Subject: Fix pylint warnings/errors in cli MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cli_testcase and cli_tier have been refactored to avoid duplicating code. Then functest/cli and funtest/unit/cli can be added to the list of modules rated 10/10. Change-Id: Iec90e806397248a10f39080ec554e3f0a6eda7c1 Signed-off-by: Cédric Ollivier --- functest/cli/commands/cli_env.py | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'functest/cli/commands/cli_env.py') diff --git a/functest/cli/commands/cli_env.py b/functest/cli/commands/cli_env.py index c41f8f34..c1b66da4 100644 --- a/functest/cli/commands/cli_env.py +++ b/functest/cli/commands/cli_env.py @@ -5,7 +5,8 @@ # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 -# + +# pylint: disable=missing-docstring import click import prettytable @@ -15,12 +16,10 @@ from functest.utils.constants import CONST import six -class Env(object): +class Env(object): # pylint: disable=too-few-public-methods - def __init__(self): - pass - - def show(self): + @staticmethod + def show(): def _get_value(attr, default='Unknown'): return attr if attr else default @@ -44,13 +43,11 @@ class Env(object): return env_info -class CliEnv(Env): - - def __init__(self): - super(CliEnv, self).__init__() +class CliEnv(object): # pylint: disable=too-few-public-methods - def show(self): - env_info = super(CliEnv, self).show() + @staticmethod + def show(): + env_info = Env.show() msg = prettytable.PrettyTable( header_style='upper', padding_width=5, field_names=['Functest Environment', 'value']) -- cgit 1.2.3-korg