Fix dict ordering issue in action executions CLI test

Change-Id: I19e53dce2e342285858399739b787d24d837ac6e
This commit is contained in:
Renat Akhmerov
2015-10-16 15:25:42 +06:00
parent a9ee49cc49
commit adc5dbb632

View File

@@ -61,8 +61,10 @@ class TestCLIActionExecutions(base.BaseCommandTest):
app_args=['some', '{"output": "Hello!"}'] app_args=['some', '{"output": "Hello!"}']
) )
self.app.stdout.write.assert_called_with( self.assertDictEqual(
json.dumps(ACTION_EX_RESULT) + "\n") ACTION_EX_RESULT,
json.loads(self.app.stdout.write.call_args[0][0])
)
@mock.patch( @mock.patch(
'mistralclient.api.v2.action_executions.ActionExecutionManager.create' 'mistralclient.api.v2.action_executions.ActionExecutionManager.create'
@@ -79,7 +81,8 @@ class TestCLIActionExecutions(base.BaseCommandTest):
self.assertEqual( self.assertEqual(
('123', 'some', 'thing', 'task1', 'RUNNING', ('123', 'some', 'thing', 'task1', 'RUNNING',
'RUNNING somehow.', True), result[1] 'RUNNING somehow.', True),
result[1]
) )
@mock.patch( @mock.patch(
@@ -106,7 +109,8 @@ class TestCLIActionExecutions(base.BaseCommandTest):
self.assertEqual( self.assertEqual(
[('123', 'some', 'thing', 'task1', 'RUNNING', [('123', 'some', 'thing', 'task1', 'RUNNING',
'RUNNING somehow.', True)], result[1] 'RUNNING somehow.', True)],
result[1]
) )
@mock.patch( @mock.patch(
@@ -130,8 +134,10 @@ class TestCLIActionExecutions(base.BaseCommandTest):
self.call(action_ex_cmd.GetOutput, app_args=['id']) self.call(action_ex_cmd.GetOutput, app_args=['id'])
self.app.stdout.write.assert_called_with( self.assertDictEqual(
json.dumps(ACTION_EX_RESULT, indent=4) + "\n") ACTION_EX_RESULT,
json.loads(self.app.stdout.write.call_args[0][0])
)
@mock.patch( @mock.patch(
'mistralclient.api.v2.action_executions.ActionExecutionManager.get' 'mistralclient.api.v2.action_executions.ActionExecutionManager.get'
@@ -141,8 +147,9 @@ class TestCLIActionExecutions(base.BaseCommandTest):
self.call(action_ex_cmd.GetInput, app_args=['id']) self.call(action_ex_cmd.GetInput, app_args=['id'])
self.app.stdout.write.assert_called_with( self.assertDictEqual(
json.dumps(ACTION_EX_INPUT, indent=4) + "\n" ACTION_EX_INPUT,
json.loads(self.app.stdout.write.call_args[0][0])
) )
@mock.patch( @mock.patch(