Update hacking and fix warning

Change-Id: If1358bcfc3f914956f8917cbbcea894f6264febc
This commit is contained in:
Eyal 2020-01-07 14:58:46 +02:00
parent fd02f4c7f8
commit 1c3a3f2248
6 changed files with 26 additions and 24 deletions

View File

@ -103,4 +103,5 @@ class ActionContextSerializer(serialization.DictBasedSerializer):
execution_ctx=ExecutionContext(**entity_dict['execution'])
)
serialization.register_serializer(ActionContext, ActionContextSerializer())

View File

@ -78,4 +78,5 @@ class ResultSerializer(serialization.DictBasedSerializer):
entity_dict.get('cancel', False)
)
serialization.register_serializer(Result, ResultSerializer())

View File

@ -15,28 +15,28 @@ from mistral_lib.tests import base as tests_base
def _fake_context():
security_ctx = context.SecurityContext(
auth_uri='auth_uri',
auth_cacert='auth_cacert',
insecure='insecure',
service_catalog='service_catalog',
region_name='region_name',
is_trust_scoped='is_trust_scoped',
redelivered='redelivered',
expires_at='expires_at',
trust_id='trust_id',
is_target='is_target',
project_id='project_id')
security_ctx = context.SecurityContext(
auth_uri='auth_uri',
auth_cacert='auth_cacert',
insecure='insecure',
service_catalog='service_catalog',
region_name='region_name',
is_trust_scoped='is_trust_scoped',
redelivered='redelivered',
expires_at='expires_at',
trust_id='trust_id',
is_target='is_target',
project_id='project_id')
execution_ctx = context.ExecutionContext(
workflow_execution_id='workflow_execution_id',
task_execution_id='task_execution_id',
action_execution_id='action_execution_id',
workflow_name='workflow_name',
callback_url='callback_url')
execution_ctx = context.ExecutionContext(
workflow_execution_id='workflow_execution_id',
task_execution_id='task_execution_id',
action_execution_id='action_execution_id',
workflow_name='workflow_name',
callback_url='callback_url')
ctx = context.ActionContext(security_ctx, execution_ctx)
return ctx
ctx = context.ActionContext(security_ctx, execution_ctx)
return ctx
class TestActionsBase(tests_base.TestCase):

View File

@ -248,7 +248,7 @@ def cut_dict(d, length=100):
idx += 1
if 0 <= length <= len(res) and res[length - 1] is not '}':
if 0 <= length <= len(res) and res[length - 1] != '}':
res = res[:length - 3] + '...'
return res
@ -283,7 +283,7 @@ def cut_list(l, length=100):
res += "'%s'" % s if is_str else s
res += ', ' if idx < len(l) - 1 else ']'
if 0 <= length <= len(res) and res[length - 1] is not ']':
if 0 <= length <= len(res) and res[length - 1] != ']':
res = res[:length - 3] + '...'
return res

View File

@ -2,7 +2,7 @@
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
hacking>=1.1.0,<1.2.0 # Apache-2.0
hacking>=1.1.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
sphinx>=1.8.0,<2.0.0;python_version=='2.7' # BSD
sphinx>=1.8.0,!=2.1.0;python_version>='3.4' # BSD

View File

@ -58,7 +58,7 @@ commands = oslo_debug_helper -t mistral_lib/tests {posargs}
# E123, E125 skipped as they are invalid PEP-8.
show-source = True
ignore = E123,E125
ignore = E123,E125,W504
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build