Remove "plan" module. Replaced by "project" 69/34969/1
authorCharlie Root <root@freebsd.mydomain.name>
Thu, 18 May 2017 10:14:46 +0000 (15:14 +0500)
committerTaseer Ahmed <taseer94@gmail.com>
Thu, 18 May 2017 10:17:54 +0000 (15:17 +0500)
Change-Id: I5da2a3cf366e4e5a67b68e34db62219587d923e5
Signed-off-by: Taseer Ahmed <taseer94@gmail.com>
qtip/cli/commands/cmd_plan.py [deleted file]
tests/unit/cli/cmd_plan_test.py [deleted file]

diff --git a/qtip/cli/commands/cmd_plan.py b/qtip/cli/commands/cmd_plan.py
deleted file mode 100644 (file)
index b7c540b..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-##############################################################################
-# Copyright (c) 2016 taseer94@gmail.com and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-
-import click
-from colorama import Fore
-import os
-
-from qtip.base.error import InvalidContentError
-from qtip.base.error import NotFoundError
-from qtip.cli import utils
-from qtip.cli.entry import Context
-from qtip.loader.plan import Plan
-
-
-pass_context = click.make_pass_decorator(Context, ensure=False)
-
-
-@click.group()
-@pass_context
-def cli(ctx):
-    ''' Bechmarking Plan '''
-    pass
-
-
-@cli.command('init', help='Initialize Environment')
-@pass_context
-def init(ctx):
-    pass
-
-
-@cli.command('list', help='List the Plans')
-@pass_context
-def list(ctx):
-    plans = Plan.list_all()
-    table = utils.table('Plans', plans)
-    click.echo(table)
-
-
-@cli.command('show', help='View details of a Plan')
-@click.argument('name')
-@pass_context
-def show(ctx, name):
-    try:
-        plan = Plan('{}.yaml'.format(name))
-    except NotFoundError as nf:
-        click.echo(Fore.RED + "ERROR: plan spec: " + nf.message)
-    except InvalidContentError as ice:
-        click.echo(Fore.RED + "ERROR: plan spec: " + ice.message)
-    else:
-        cnt = plan.content
-        output = utils.render('plan', cnt)
-        click.echo(output)
-
-
-@cli.command('run', help='Execute a Plan')
-@click.argument('name')
-@click.option('-p', '--path', help='Path to store results')
-@pass_context
-def run(ctx, name, path):
-    runner_path = os.path.join(os.path.dirname(__file__), os.path.pardir, os.path.pardir,
-                               'runner/runner.py')
-    os.system('python {0} -b all -d {1}'.format(runner_path, path))
diff --git a/tests/unit/cli/cmd_plan_test.py b/tests/unit/cli/cmd_plan_test.py
deleted file mode 100644 (file)
index 53a0480..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-###############################################################
-# Copyright (c) 2017 taseer94@gmail.com and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-import pytest
-from click.testing import CliRunner
-
-from qtip.cli.entry import cli
-
-
-@pytest.fixture(scope="module")
-def runner():
-    return CliRunner()
-
-
-def test_list(runner):
-    result = runner.invoke(cli, ['plan', 'list'])
-    assert 'Plan' and 'compute' and 'sample' in result.output
-
-
-def test_run(runner):
-    result = runner.invoke(cli, ['plan', 'run', 'fake-plan'])
-    assert result.output == ''
-
-    result = runner.invoke(cli, ['plan', 'run'])
-    assert 'Missing argument "name".' in result.output
-
-
-def test_show(runner):
-    result = runner.invoke(cli, ['plan', 'show', 'compute'])
-    assert 'Name: compute QPI' in result.output
-    assert 'Description: compute QPI profile'
-
-    result = runner.invoke(cli, ['plan', 'show'])
-    assert 'Missing argument "name".' in result.output
-
-    result = runner.invoke(cli, ['plan', 'show', 'xyz'])
-    assert "ERROR: plan spec: xyz not found" in result.output