Tidy up
In this changeset, I do some tidy up so I can later on make it easier to refactor the lot. Partially Implements: blueprint openstackclient-plugin Change-Id: I566101fb951b9489481a3e6c1a4008c80b14f6fd
This commit is contained in:
parent
94af770a6d
commit
cbc578998a
@ -1,7 +1,7 @@
|
|||||||
[DEFAULT]
|
[DEFAULT]
|
||||||
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
|
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
|
||||||
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
|
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
|
||||||
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-10} \
|
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-160} \
|
||||||
${PYTHON:-python} -m subunit.run discover -t ./ . $LISTOPT $IDOPTION
|
${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./watcherclient/tests} $LISTOPT $IDOPTION
|
||||||
test_id_option=--load-list $IDFILE
|
test_id_option=--load-list $IDFILE
|
||||||
test_list_option=--list
|
test_list_option=--list
|
||||||
|
@ -10,6 +10,7 @@ oslosphinx!=3.4.0,>=2.5.0 # Apache-2.0
|
|||||||
oslotest>=1.10.0 # Apache-2.0
|
oslotest>=1.10.0 # Apache-2.0
|
||||||
python-subunit>=0.0.18 # Apache-2.0/BSD
|
python-subunit>=0.0.18 # Apache-2.0/BSD
|
||||||
sphinx!=1.2.0,!=1.3b1,<1.3,>=1.1.2 # BSD
|
sphinx!=1.2.0,!=1.3b1,<1.3,>=1.1.2 # BSD
|
||||||
|
tempest-lib>=0.14.0 # Apache-2.0
|
||||||
testrepository>=0.0.18 # Apache-2.0/BSD
|
testrepository>=0.0.18 # Apache-2.0/BSD
|
||||||
testscenarios>=0.4 # Apache-2.0/BSD
|
testscenarios>=0.4 # Apache-2.0/BSD
|
||||||
testtools>=1.4.0 # MIT
|
testtools>=1.4.0 # MIT
|
||||||
|
@ -45,6 +45,8 @@ def _trim_endpoint_api_version(url):
|
|||||||
def _extract_error_json(body):
|
def _extract_error_json(body):
|
||||||
"""Return error_message from the HTTP response body."""
|
"""Return error_message from the HTTP response body."""
|
||||||
error_json = {}
|
error_json = {}
|
||||||
|
if six.PY3 and not isinstance(body, six.string_types):
|
||||||
|
body = body.decode("utf-8")
|
||||||
try:
|
try:
|
||||||
body_json = json.loads(body)
|
body_json = json.loads(body)
|
||||||
if 'error_message' in body_json:
|
if 'error_message' in body_json:
|
||||||
|
@ -21,13 +21,13 @@ import os
|
|||||||
|
|
||||||
import fixtures
|
import fixtures
|
||||||
from oslo_utils import strutils
|
from oslo_utils import strutils
|
||||||
|
from oslotest import base
|
||||||
import six
|
import six
|
||||||
import testtools
|
|
||||||
|
|
||||||
from watcherclient.common import http
|
from watcherclient.common import http
|
||||||
|
|
||||||
|
|
||||||
class BaseTestCase(testtools.TestCase):
|
class BaseTestCase(base.BaseTestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(BaseTestCase, self).setUp()
|
super(BaseTestCase, self).setUp()
|
||||||
|
@ -31,10 +31,8 @@ class ActionShellTest(utils.BaseTestCase):
|
|||||||
action = object()
|
action = object()
|
||||||
a_shell._print_action_show(action)
|
a_shell._print_action_show(action)
|
||||||
exp = ['action_type',
|
exp = ['action_type',
|
||||||
'applies_to',
|
|
||||||
'created_at',
|
'created_at',
|
||||||
'deleted_at',
|
'deleted_at',
|
||||||
'description',
|
|
||||||
'next_uuid',
|
'next_uuid',
|
||||||
'input_parameters',
|
'input_parameters',
|
||||||
'state',
|
'state',
|
||||||
|
@ -86,3 +86,7 @@ class ActionPlanManager(base.Manager):
|
|||||||
|
|
||||||
def update(self, action_plan_id, patch):
|
def update(self, action_plan_id, patch):
|
||||||
return self._update(self._path(action_plan_id), patch)
|
return self._update(self._path(action_plan_id), patch)
|
||||||
|
|
||||||
|
def start(self, action_plan_id):
|
||||||
|
patch = [{'op': 'replace', 'value': 'PENDING', 'path': '/state'}]
|
||||||
|
return self._update(self._path(action_plan_id), patch)
|
||||||
|
@ -58,12 +58,12 @@ ACTION_PLAN_SHORT_LIST_FIELD_LABELS = ['UUID', 'Audit', 'State', 'Updated At']
|
|||||||
|
|
||||||
# Action
|
# Action
|
||||||
ACTION_FIELDS = ['uuid', 'created_at', 'updated_at', 'deleted_at', 'next_uuid',
|
ACTION_FIELDS = ['uuid', 'created_at', 'updated_at', 'deleted_at', 'next_uuid',
|
||||||
'description', 'state', 'action_plan_uuid',
|
'state', 'action_plan_uuid', 'action_type',
|
||||||
'action_type', 'applies_to', 'input_parameters']
|
'input_parameters']
|
||||||
|
|
||||||
ACTION_FIELD_LABELS = ['UUID', 'Created At', 'Updated At', 'Deleted At',
|
ACTION_FIELD_LABELS = ['UUID', 'Created At', 'Updated At', 'Deleted At',
|
||||||
'Next Action', 'Description', 'State',
|
'Next Action', 'State', 'Action Plan', 'Action',
|
||||||
'Action Plan', 'Action', 'Applies to', 'Parameters']
|
'Parameters']
|
||||||
|
|
||||||
ACTION_SHORT_LIST_FIELDS = ['uuid', 'next_uuid',
|
ACTION_SHORT_LIST_FIELDS = ['uuid', 'next_uuid',
|
||||||
'state', 'action_plan_uuid', 'action_type']
|
'state', 'action_plan_uuid', 'action_type']
|
||||||
|
@ -16,3 +16,4 @@
|
|||||||
from pbr import version
|
from pbr import version
|
||||||
|
|
||||||
version_info = version.VersionInfo('python-watcherclient')
|
version_info = version.VersionInfo('python-watcherclient')
|
||||||
|
__version__ = version_info.version_string()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user