From 0d78f17e010a745bb4c96ab3b55d097c9b16d375 Mon Sep 17 00:00:00 2001 From: Michael Gummelt Date: Thu, 28 May 2015 11:00:46 -0700 Subject: [PATCH] s/tasks/task --- cli/dcoscli/{tasks => task}/__init__.py | 0 cli/dcoscli/{tasks => task}/main.py | 22 ++++++------- cli/setup.py | 2 +- cli/tests/integrations/cli/test_dcos.py | 2 +- cli/tests/integrations/cli/test_help.py | 2 +- .../cli/{test_tasks.py => test_task.py} | 32 +++++++++---------- 6 files changed, 30 insertions(+), 30 deletions(-) rename cli/dcoscli/{tasks => task}/__init__.py (100%) rename cli/dcoscli/{tasks => task}/main.py (87%) rename cli/tests/integrations/cli/{test_tasks.py => test_task.py} (83%) diff --git a/cli/dcoscli/tasks/__init__.py b/cli/dcoscli/task/__init__.py similarity index 100% rename from cli/dcoscli/tasks/__init__.py rename to cli/dcoscli/task/__init__.py diff --git a/cli/dcoscli/tasks/main.py b/cli/dcoscli/task/main.py similarity index 87% rename from cli/dcoscli/tasks/main.py rename to cli/dcoscli/task/main.py index 442b6f1..ef72bf6 100644 --- a/cli/dcoscli/tasks/main.py +++ b/cli/dcoscli/task/main.py @@ -1,8 +1,8 @@ -"""Get the status of mesos tasks +"""Get the status of DCOS tasks Usage: - dcos tasks --info - dcos tasks [--completed --json ] + dcos task --info + dcos task [--completed --json ] Options: -h, --help Show this screen @@ -44,7 +44,7 @@ def _main(): args = docopt.docopt( __doc__, - version="dcos-tasks version {}".format(dcoscli.version)) + version="dcos-task version {}".format(dcoscli.version)) return cmds.execute(_cmds(), args) @@ -57,19 +57,19 @@ def _cmds(): return [ cmds.Command( - hierarchy=['tasks', '--info'], + hierarchy=['task', '--info'], arg_keys=[], function=_info), cmds.Command( - hierarchy=['tasks'], + hierarchy=['task'], arg_keys=['', '--completed', '--json'], - function=_tasks), + function=_task), ] def _info(): - """Print tasks cli information. + """Print task cli information. :returns: process return code :rtype: int @@ -113,12 +113,12 @@ def _task_table(tasks): return tb -def _tasks(fltr, completed, is_json): - """ List mesos tasks +def _task(fltr, completed, is_json): + """ List DCOS tasks :param fltr: task id filter :type fltr: str - :param completed: If True, include compelted tasks + :param completed: If True, include completed tasks :type completed: bool :param is_json: If true, output json. Otherwise, output a human readable table. diff --git a/cli/setup.py b/cli/setup.py index 27d73b8..50473b1 100644 --- a/cli/setup.py +++ b/cli/setup.py @@ -97,7 +97,7 @@ setup( 'dcos-config=dcoscli.config.main:main', 'dcos-marathon=dcoscli.marathon.main:main', 'dcos-package=dcoscli.package.main:main', - 'dcos-tasks=dcoscli.tasks.main:main', + 'dcos-task=dcoscli.task.main:main', ], }, diff --git a/cli/tests/integrations/cli/test_dcos.py b/cli/tests/integrations/cli/test_dcos.py index 48afa7a..8b3f205 100644 --- a/cli/tests/integrations/cli/test_dcos.py +++ b/cli/tests/integrations/cli/test_dcos.py @@ -21,7 +21,7 @@ Available DCOS commands: \thelp \tDisplay command line usage information \tmarathon \tDeploy and manage applications on the DCOS \tpackage \tInstall and manage DCOS software packages -\ttasks \tGet the status of mesos tasks +\ttask \tGet the status of DCOS tasks Get detailed command description with 'dcos --help'. """.encode('utf-8') diff --git a/cli/tests/integrations/cli/test_help.py b/cli/tests/integrations/cli/test_help.py index 9946bcd..d108f4b 100644 --- a/cli/tests/integrations/cli/test_help.py +++ b/cli/tests/integrations/cli/test_help.py @@ -40,7 +40,7 @@ Available DCOS commands: \thelp \tDisplay command line usage information \tmarathon \tDeploy and manage applications on the DCOS \tpackage \tInstall and manage DCOS software packages -\ttasks \tGet the status of mesos tasks +\ttask \tGet the status of DCOS tasks Get detailed command description with 'dcos --help'. """.encode('utf-8') diff --git a/cli/tests/integrations/cli/test_tasks.py b/cli/tests/integrations/cli/test_task.py similarity index 83% rename from cli/tests/integrations/cli/test_tasks.py rename to cli/tests/integrations/cli/test_task.py index 20a9bcb..fb61444 100644 --- a/cli/tests/integrations/cli/test_tasks.py +++ b/cli/tests/integrations/cli/test_task.py @@ -4,7 +4,7 @@ import json import dcos.util as util from dcos.mesos import Task from dcos.util import create_schema -from dcoscli.tasks.main import _task_table +from dcoscli.task.main import _task_table import mock import pytest @@ -44,11 +44,11 @@ def task(): def test_help(): - stdout = b"""Get the status of mesos tasks + stdout = b"""Get the status of DCOS tasks Usage: - dcos tasks --info - dcos tasks [--completed --json ] + dcos task --info + dcos task [--completed --json ] Options: -h, --help Show this screen @@ -62,19 +62,19 @@ Positional Arguments: Only match tasks whose ID matches . may be a substring of the ID, or a unix glob pattern. """ - assert_command(['dcos', 'tasks', '--help'], stdout=stdout) + assert_command(['dcos', 'task', '--help'], stdout=stdout) def test_info(): - stdout = b"Get the status of mesos tasks\n" - assert_command(['dcos', 'tasks', '--info'], stdout=stdout) + stdout = b"Get the status of DCOS tasks\n" + assert_command(['dcos', 'task', '--info'], stdout=stdout) -def test_tasks(task): +def test_task(task): _install_sleep_task() - # test `dcos tasks` output - returncode, stdout, stderr = exec_command(['dcos', 'tasks', '--json']) + # test `dcos task` output + returncode, stdout, stderr = exec_command(['dcos', 'task', '--json']) assert returncode == 0 assert stderr == b'' @@ -90,19 +90,19 @@ def test_tasks(task): _uninstall_sleep() -def test_tasks_completed(): +def test_task_completed(): _install_sleep_task() _uninstall_sleep() _install_sleep_task() returncode, stdout, stderr = exec_command( - ['dcos', 'tasks', '--completed', '--json']) + ['dcos', 'task', '--completed', '--json']) assert returncode == 0 assert stderr == b'' assert len(json.loads(stdout.decode('utf-8'))) > 1 returncode, stdout, stderr = exec_command( - ['dcos', 'tasks', '--json']) + ['dcos', 'task', '--json']) assert returncode == 0 assert stderr == b'' assert len(json.loads(stdout.decode('utf-8'))) == 1 @@ -110,8 +110,8 @@ def test_tasks_completed(): _uninstall_sleep() -def test_tasks_none(): - assert_command(['dcos', 'tasks', '--json'], +def test_task_none(): + assert_command(['dcos', 'task', '--json'], stdout=b'[]\n') @@ -120,7 +120,7 @@ def test_filter(task): _install_sleep_task(SLEEP2, 'test-app2') returncode, stdout, stderr = exec_command( - ['dcos', 'tasks', 'test-app2', '--json']) + ['dcos', 'task', 'test-app2', '--json']) assert returncode == 0 assert stderr == b''