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:
hparekh 2015-10-20 16:21:17 +05:30
parent bfe0a517c7
commit 7852684d0f
4 changed files with 6 additions and 4 deletions

View File

@ -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)

View File

@ -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):

View File

@ -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]
)

View File

@ -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
}
]