aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYujun Zhang <zhang.yujunz@zte.com.cn>2017-02-23 11:01:09 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-02-23 11:01:09 +0000
commit78f7b4aeff2a5dc572e2878ba7445750ffb8b860 (patch)
tree57e24efb0cea79b1e65b775aa46238174ecb57b2
parent154b1e3ee985ce51d53b3ec05e356b674c4733e6 (diff)
parenta0a2c2388b9c05c2dff3425b581b33d1695d56eb (diff)
Merge "Addition of detail viewing command."
-rw-r--r--qtip/cli/commands/cmd_metric.py7
-rw-r--r--qtip/cli/commands/cmd_plan.py7
-rw-r--r--qtip/cli/commands/cmd_qpi.py7
-rw-r--r--tests/unit/cli/cmd_metric_test.py10
-rw-r--r--tests/unit/cli/cmd_plan_test.py10
-rw-r--r--tests/unit/cli/cmd_qpi_test.py10
6 files changed, 48 insertions, 3 deletions
diff --git a/qtip/cli/commands/cmd_metric.py b/qtip/cli/commands/cmd_metric.py
index aa4df1f4..b6035e2d 100644
--- a/qtip/cli/commands/cmd_metric.py
+++ b/qtip/cli/commands/cmd_metric.py
@@ -27,6 +27,13 @@ def cmd_list(ctx):
pass
+@cli.command('show', help='View details of a Metric')
+@click.argument('name')
+@pass_context
+def show(ctx, name):
+ pass
+
+
@cli.command('run', help='Run tests to run Performance Metrics')
@click.argument('name')
@pass_context
diff --git a/qtip/cli/commands/cmd_plan.py b/qtip/cli/commands/cmd_plan.py
index c1dd7cf6..64c702d3 100644
--- a/qtip/cli/commands/cmd_plan.py
+++ b/qtip/cli/commands/cmd_plan.py
@@ -35,6 +35,13 @@ def list(ctx):
pass
+@cli.command('show', help='View details of a Plan')
+@click.argument('name')
+@pass_context
+def show(ctx, name):
+ pass
+
+
@cli.command('run', help='Execute a Plan')
@click.argument('name')
@pass_context
diff --git a/qtip/cli/commands/cmd_qpi.py b/qtip/cli/commands/cmd_qpi.py
index f33f0104..5fc9bec8 100644
--- a/qtip/cli/commands/cmd_qpi.py
+++ b/qtip/cli/commands/cmd_qpi.py
@@ -28,6 +28,13 @@ def cmd_list(ctx):
pass
+@cli.command('show', help='View details of a QPI')
+@click.argument('name')
+@pass_context
+def show(ctx, name):
+ pass
+
+
@cli.command('run', help='Run performance tests for the specified QPI')
@click.argument('name')
@pass_context
diff --git a/tests/unit/cli/cmd_metric_test.py b/tests/unit/cli/cmd_metric_test.py
index 239da96e..30f3448a 100644
--- a/tests/unit/cli/cmd_metric_test.py
+++ b/tests/unit/cli/cmd_metric_test.py
@@ -13,7 +13,7 @@ from click.testing import CliRunner
from qtip.cli.entry import cli
-@pytest.fixture()
+@pytest.fixture(scope="module")
def runner():
return CliRunner()
@@ -29,3 +29,11 @@ def test_run(runner):
result = runner.invoke(cli, ['metric', 'run'])
assert 'Missing argument "name".' in result.output
+
+
+def test_show(runner):
+ result = runner.invoke(cli, ['metric', 'show', 'fake-metric'])
+ assert result.output == ''
+
+ result = runner.invoke(cli, ['metric', 'show'])
+ assert 'Missing argument "name".' in result.output
diff --git a/tests/unit/cli/cmd_plan_test.py b/tests/unit/cli/cmd_plan_test.py
index 3ce3766e..1708c340 100644
--- a/tests/unit/cli/cmd_plan_test.py
+++ b/tests/unit/cli/cmd_plan_test.py
@@ -13,7 +13,7 @@ from click.testing import CliRunner
from qtip.cli.entry import cli
-@pytest.fixture()
+@pytest.fixture(scope="module")
def runner():
return CliRunner()
@@ -29,3 +29,11 @@ def test_run(runner):
result = runner.invoke(cli, ['plan', 'run'])
assert 'Missing argument "name".' in result.output
+
+
+def test_show(runner):
+ result = runner.invoke(cli, ['plan', 'show', 'fake-plan'])
+ assert result.output == ''
+
+ result = runner.invoke(cli, ['plan', 'show'])
+ assert 'Missing argument "name".' in result.output
diff --git a/tests/unit/cli/cmd_qpi_test.py b/tests/unit/cli/cmd_qpi_test.py
index 992c85d7..485d5462 100644
--- a/tests/unit/cli/cmd_qpi_test.py
+++ b/tests/unit/cli/cmd_qpi_test.py
@@ -13,7 +13,7 @@ from click.testing import CliRunner
from qtip.cli.entry import cli
-@pytest.fixture()
+@pytest.fixture(scope="module")
def runner():
return CliRunner()
@@ -29,3 +29,11 @@ def test_run(runner):
result = runner.invoke(cli, ['qpi', 'run'])
assert 'Missing argument "name".' in result.output
+
+
+def test_show(runner):
+ result = runner.invoke(cli, ['qpi', 'show', 'fake-qpi'])
+ assert result.output == ''
+
+ result = runner.invoke(cli, ['qpi', 'show'])
+ assert 'Missing argument "name".' in result.output