summaryrefslogtreecommitdiffstats
path: root/qtip/cli
diff options
context:
space:
mode:
authorYujun Zhang <zhang.yujunz@zte.com.cn>2016-12-21 00:19:46 +0800
committerYujun Zhang <zhang.yujunz@zte.com.cn>2016-12-27 09:45:34 +0800
commit929bcdf94d14062e042d9f9451c28315a18e808d (patch)
treed57ef7c074348fb654a9d4b7cea8b69241474040 /qtip/cli
parent16cfb003cd0f1b0dbf903432ab794cda2c7a4123 (diff)
Implment https://wiki.opnfv.org/display/qtip/Design
Note that some obsolete test cases are marked expected failure, will be deprecated after architecture evolution. JIRA: QTIP-148 Change-Id: I52bc9391569d516e298d9e659517161b4dce794a Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
Diffstat (limited to 'qtip/cli')
-rw-r--r--qtip/cli/commands/cmd_plan.py (renamed from qtip/cli/commands/cmd_testplan.py)34
1 files changed, 14 insertions, 20 deletions
diff --git a/qtip/cli/commands/cmd_testplan.py b/qtip/cli/commands/cmd_plan.py
index 200e4665..01bf8251 100644
--- a/qtip/cli/commands/cmd_testplan.py
+++ b/qtip/cli/commands/cmd_plan.py
@@ -8,10 +8,8 @@
##############################################################################
import click
-import sys
from prettytable import PrettyTable
-
-from qtip.runner.testplan import TestPlan
+from qtip.runner.plan import Plan
@click.group()
@@ -20,30 +18,26 @@ def cli():
@cli.group()
-def testplan():
+def plan_cmd():
pass
-@testplan.command('list', help='List the different TestPlans.')
-def list():
- testplans = TestPlan.list_all()
+@plan_cmd.command('list', help='List the different TestPlans.')
+def list_all():
+ plans = Plan.list_all()
table = PrettyTable(["Testplans"])
table.align = 'l'
- for testplan in testplans:
- table.add_row([testplan['name']])
+ for plan in plans:
+ table.add_row([plan['name']])
click.echo(table)
-@testplan.command('show', help='Show details of specified TestPlan.')
+@plan_cmd.command('show', help='Show details of specified TestPlan.')
@click.argument('name')
def show(name):
- plan = TestPlan(name)
- desc = plan.describe()
- if desc['abspath'] is None:
- click.echo("Wrong TestPlan specified")
- sys.exit(1)
- else:
- table = PrettyTable(["Name", "Description"])
- table.align = 'l'
- table.add_row([desc['name'], desc['description']])
- click.echo(table)
+ plan = Plan(name)
+ results = plan.content()
+ table = PrettyTable(["Name", "Description"])
+ table.align = 'l'
+ table.add_row([results['name'], results['description']])
+ click.echo(table)