diff options
author | Cedric Ollivier <cedric.ollivier@orange.com> | 2017-08-17 11:12:52 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-08-17 11:12:52 +0000 |
commit | f01fb5609298c7c4b0f19cfe8d54fc331dd5a0ad (patch) | |
tree | 36b2ffb2b8d56dfabe02b0e85ff30d3822fca51a /functest/cli/commands/cli_testcase.py | |
parent | c582427bd2586347fd21bcee3b28a2f7e75faf3d (diff) | |
parent | ecaecd74a20e4845fb748077b759a5697ba86f1c (diff) |
Merge "API proposal for functest"
Diffstat (limited to 'functest/cli/commands/cli_testcase.py')
-rw-r--r-- | functest/cli/commands/cli_testcase.py | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/functest/cli/commands/cli_testcase.py b/functest/cli/commands/cli_testcase.py index cb3d4739..65dd9ab7 100644 --- a/functest/cli/commands/cli_testcase.py +++ b/functest/cli/commands/cli_testcase.py @@ -20,7 +20,7 @@ import functest.utils.functest_utils as ft_utils import functest.utils.functest_vacation as vacation -class CliTestcase(object): +class Testcase(object): def __init__(self): self.tiers = tb.TierBuilder( @@ -33,15 +33,11 @@ class CliTestcase(object): for tier in self.tiers.get_tiers(): for test in tier.get_tests(): summary += (" %s\n" % test.get_name()) - click.echo(summary) + return summary def show(self, testname): description = self.tiers.get_test(testname) - if description is None: - click.echo("The test case '%s' does not exist or is not supported." - % testname) - - click.echo(description) + return description @staticmethod def run(testname, noclean=False, report=False): @@ -62,3 +58,20 @@ class CliTestcase(object): for test in tests: cmd = "run_tests {}-t {}".format(flags, test) ft_utils.execute_command(cmd) + + +class CliTestcase(Testcase): + + def __init__(self): + super(CliTestcase, self).__init__() + + def list(self): + click.echo(super(CliTestcase, self).list()) + + def show(self, testname): + testcase_show = super(CliTestcase, self).show(testname) + if testcase_show: + click.echo(testcase_show) + else: + click.echo("The test case '%s' does not exist or is not supported." + % testname) |