Fixed some unit test issue.
1) 'output' property has been added to WF_EXECS. 2) In py34,'message' attrubute has been removed from exception class. So 'args[0]' has been used instead of 'message'. Partially-Implements: blueprint mistral-py3 Change-Id: I626de3d9305f4f8d52bbeaf2b1094c9e96563cae
This commit is contained in:
parent
bfe0a517c7
commit
7852684d0f
@ -228,7 +228,7 @@ class EngineServer(object):
|
||||
|
||||
|
||||
def _wrap_exception_and_reraise(exception):
|
||||
message = "%s: %s" % (exception.__class__.__name__, exception.message)
|
||||
message = "%s: %s" % (exception.__class__.__name__, exception.args[0])
|
||||
|
||||
raise exc.MistralException(message)
|
||||
|
||||
|
@ -210,7 +210,7 @@ class TestExecutionsController(base.FunctionalTest):
|
||||
WF_EX_JSON
|
||||
)
|
||||
|
||||
self.assertIn('Bad response: 400', context.message)
|
||||
self.assertIn('Bad response: 400', context.args[0])
|
||||
|
||||
@mock.patch.object(db_api, 'delete_workflow_execution', MOCK_DELETE)
|
||||
def test_delete(self):
|
||||
|
@ -52,7 +52,7 @@ class TestServicesController(base.FunctionalTest):
|
||||
'/v2/services',
|
||||
)
|
||||
|
||||
self.assertIn('Service API is not supported', context.message)
|
||||
self.assertIn('Service API is not supported', context.args[0])
|
||||
|
||||
@mock.patch('mistral.coordination.ServiceCoordinator.get_members',
|
||||
side_effect=tooz.coordination.ToozError('error message'))
|
||||
@ -70,5 +70,5 @@ class TestServicesController(base.FunctionalTest):
|
||||
|
||||
self.assertIn(
|
||||
'Failed to get service members from coordination backend',
|
||||
context.message
|
||||
context.args[0]
|
||||
)
|
||||
|
@ -683,6 +683,7 @@ WF_EXECS = [
|
||||
'task_id': None,
|
||||
'trust_id': None,
|
||||
'description': None,
|
||||
'output': None
|
||||
},
|
||||
{
|
||||
'spec': {},
|
||||
@ -695,6 +696,7 @@ WF_EXECS = [
|
||||
'task_id': None,
|
||||
'trust_id': None,
|
||||
'description': None,
|
||||
'output': None
|
||||
}
|
||||
]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user