diff options
author | 2016-12-22 10:53:36 +0800 | |
---|---|---|
committer | 2016-12-22 19:28:12 +0800 | |
commit | 2632ba86dd920267455ee10154b9e2ce4695a889 (patch) | |
tree | 32a9c96d6b5bb5db69d750976938faaa68695635 /functest/cli/commands/cli_tier.py | |
parent | 62ffd8a7e6790ab0377550740d3cfe8eea298392 (diff) |
refactor cli module using new constants provider
JIRA: FUNCTEST-673
Change-Id: I643fb16c694a8d7df45a13237f34b19a02906881
Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'functest/cli/commands/cli_tier.py')
-rw-r--r-- | functest/cli/commands/cli_tier.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/functest/cli/commands/cli_tier.py b/functest/cli/commands/cli_tier.py index 9da51072..01208498 100644 --- a/functest/cli/commands/cli_tier.py +++ b/functest/cli/commands/cli_tier.py @@ -14,17 +14,16 @@ import os import click import functest.ci.tier_builder as tb +from functest.utils.constants import CONST import functest.utils.functest_utils as ft_utils -import functest.utils.functest_constants as ft_constants class CliTier: def __init__(self): - CI_INSTALLER_TYPE = ft_constants.CI_INSTALLER_TYPE - CI_SCENARIO = ft_constants.CI_SCENARIO - testcases = ft_constants.FUNCTEST_TESTCASES_YAML - self.tiers = tb.TierBuilder(CI_INSTALLER_TYPE, CI_SCENARIO, testcases) + self.tiers = tb.TierBuilder(CONST.INSTALLER_TYPE, + CONST.DEPLOY_SCENARIO, + CONST.functest_testcases_yaml) def list(self): summary = "" @@ -54,15 +53,16 @@ class CliTier: tests = tier.get_test_names() click.echo("Test cases in tier '%s':\n %s\n" % (tiername, tests)) - def run(self, tiername, noclean=False): - if not os.path.isfile(ft_constants.ENV_FILE): + @staticmethod + def run(tiername, noclean=False): + if not os.path.isfile(CONST.env_active): click.echo("Functest environment is not ready. " "Run first 'functest env prepare'") else: if noclean: cmd = ("python %s/functest/ci/run_tests.py " - "-n -t %s" % (ft_constants.FUNCTEST_REPO_DIR, tiername)) + "-n -t %s" % (CONST.dir_repo_functest, tiername)) else: cmd = ("python %s/functest/ci/run_tests.py " - "-t %s" % (ft_constants.FUNCTEST_REPO_DIR, tiername)) + "-t %s" % (CONST.dir_repo_functest, tiername)) ft_utils.execute_command(cmd) |