Addition of detail viewing command. 85/29185/3
authorTaseer Ahmed <taseer94@gmail.com>
Wed, 22 Feb 2017 01:45:45 +0000 (06:45 +0500)
committerTaseer Ahmed <taseer94@gmail.com>
Wed, 22 Feb 2017 02:04:15 +0000 (07:04 +0500)
Change-Id: Ia9ad825f20b279db1852587540a2ad6cb3815e1d
Signed-off-by:Taseer Ahmed <taseer94@gmail.com>

qtip/cli/commands/cmd_metric.py
qtip/cli/commands/cmd_plan.py
qtip/cli/commands/cmd_qpi.py
tests/unit/cli/cmd_metric_test.py
tests/unit/cli/cmd_plan_test.py
tests/unit/cli/cmd_qpi_test.py

index aa4df1f..b6035e2 100644 (file)
@@ -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
index c1dd7cf..64c702d 100644 (file)
@@ -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
index f33f010..5fc9bec 100644 (file)
@@ -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
index 239da96..30f3448 100644 (file)
@@ -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
index 3ce3766..1708c34 100644 (file)
@@ -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
index 992c85d..485d546 100644 (file)
@@ -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