Merge "Fix order of arguments in assertEqual"

This commit is contained in:
Jenkins 2015-10-05 08:36:13 +00:00 committed by Gerrit Code Review
commit cddb8bf339
6 changed files with 27 additions and 27 deletions

View File

@ -342,7 +342,7 @@ class ExecutionCLITests(base_v2.MistralClientTestBase):
self.assertEqual(self.direct_wf['Name'], wf)
self.assertIsNotNone(created_at)
self.assertEqual(description, "execution test")
self.assertEqual("execution test", description)
execs = self.mistral_admin('execution-list')
self.assertIn(exec_id, [ex['ID'] for ex in execs])
@ -384,7 +384,7 @@ class ExecutionCLITests(base_v2.MistralClientTestBase):
description = self.get_value_of_field(execution, 'Description')
self.assertEqual(description, "execution update test")
self.assertEqual("execution update test", description)
def test_execution_get(self):
execution = self.execution_create(self.direct_wf['Name'])
@ -539,14 +539,14 @@ class ActionCLITests(base_v2.MistralClientTestBase):
action_2 = self.get_item_info(
get_from=init_acts, get_by='Name', value='farewell')
self.assertEqual(action_1['Tags'], '<none>')
self.assertEqual(action_2['Tags'], '<none>')
self.assertEqual('<none>', action_1['Tags'])
self.assertEqual('<none>', action_2['Tags'])
self.assertEqual(action_1['Is system'], 'False')
self.assertEqual(action_2['Is system'], 'False')
self.assertEqual('False', action_1['Is system'])
self.assertEqual('False', action_2['Is system'])
self.assertEqual(action_1['Input'], 'name')
self.assertEqual(action_2['Input'], 'None')
self.assertEqual('name', action_1['Input'])
self.assertEqual('None', action_2['Input'])
acts = self.mistral_admin('action-list')
self.assertIn(action_1['Name'], [action['Name'] for action in acts])
@ -583,7 +583,7 @@ class ActionCLITests(base_v2.MistralClientTestBase):
updated_action = self.get_item_info(
get_from=acts, get_by='Name', value='greeting')
self.assertEqual(updated_action['Tags'], 'tag, tag1')
self.assertEqual('tag, tag1', updated_action['Tags'])
self.assertEqual(created_action['Created at'].split(".")[0],
updated_action['Created at'])
self.assertEqual(created_action['Name'], updated_action['Name'])
@ -657,7 +657,7 @@ class EnvironmentCLITests(base_v2.MistralClientTestBase):
env_updated_at = self.get_value_of_field(env, 'Updated at')
self.assertIsNotNone(env_created_at)
self.assertEqual(env_updated_at, 'None')
self.assertEqual('None', env_updated_at)
self.create_file('env_upd.yaml',
'name: env\n'
@ -675,7 +675,7 @@ class EnvironmentCLITests(base_v2.MistralClientTestBase):
self.assertEqual(env_name, updated_env_name)
self.assertNotEqual(env_desc, updated_env_desc)
self.assertEqual(updated_env_desc, 'Updated env')
self.assertEqual('Updated env', updated_env_desc)
self.assertEqual(env_created_at.split('.')[0], updated_env_created_at)
self.assertIsNotNone(updated_env_updated_at)
@ -724,8 +724,8 @@ class ActionExecutionCLITests(base_v2.MistralClientTestBase):
act_ex_from_list['ID'],
self.get_value_of_field(act_ex, 'ID')
)
self.assertEqual(wf_name, self.direct_wf['Name'])
self.assertEqual(status, 'SUCCESS')
self.assertEqual(self.direct_wf['Name'], wf_name)
self.assertEqual('SUCCESS', status)
def test_act_execution_create_delete(self):
action_ex = self.mistral_admin(

View File

@ -35,7 +35,7 @@ class BaseShellTests(testtools.TestCase):
_shell.run(argstr.split())
except SystemExit:
exc_type, exc_value, exc_traceback = sys.exc_info()
self.assertEqual(exc_value.code, 0)
self.assertEqual(0, exc_value.code)
finally:
stdout = sys.stdout.getvalue()
stderr = sys.stderr.getvalue()

View File

@ -28,5 +28,5 @@ class BaseClientTests(testtools.TestCase):
auth_url="http://localhost:35357/v3")
self.assertTrue(mock.called)
params = mock.call_args
self.assertEqual(params[0][0],
'http://localhost:8989/v2')
self.assertEqual('http://localhost:8989/v2',
params[0][0])

View File

@ -26,7 +26,7 @@ class TestShell(base.BaseShellTests):
)
self.assertTrue(mock.called)
params = mock.call_args
self.assertEqual(params[1]['mistral_url'], '')
self.assertEqual('', params[1]['mistral_url'])
@mock.patch('mistralclient.api.client.client')
def test_command_with_mistral_url(self, mock):
@ -35,8 +35,8 @@ class TestShell(base.BaseShellTests):
)
self.assertTrue(mock.called)
params = mock.call_args
self.assertEqual(params[1]['mistral_url'],
'http://localhost:8989/v2')
self.assertEqual('http://localhost:8989/v2',
params[1]['mistral_url'])
@mock.patch('mistralclient.api.client.determine_client_version')
def test_mistral_version(self, mock):
@ -45,39 +45,39 @@ class TestShell(base.BaseShellTests):
)
self.assertTrue(mock.called)
mistral_version = mock.call_args
self.assertEqual(mistral_version[0][0], 'v1')
self.assertEqual('v1', mistral_version[0][0])
@mock.patch('mistralclient.api.client.determine_client_version')
def test_no_mistral_version(self, mock):
self.shell('workbook-list')
self.assertTrue(mock.called)
mistral_version = mock.call_args
self.assertEqual(mistral_version[0][0], 'v2')
self.assertEqual('v2', mistral_version[0][0])
@mock.patch('mistralclient.api.client.client')
def test_service_type(self, mock):
self.shell('--os-mistral-service-type=test workbook-list')
self.assertTrue(mock.called)
parmters = mock.call_args
self.assertEqual(parmters[1]['service_type'], 'test')
self.assertEqual('test', parmters[1]['service_type'])
@mock.patch('mistralclient.api.client.client')
def test_no_service_type(self, mock):
self.shell('workbook-list')
self.assertTrue(mock.called)
params = mock.call_args
self.assertEqual(params[1]['service_type'], 'workflowv2')
self.assertEqual('workflowv2', params[1]['service_type'])
@mock.patch('mistralclient.api.client.client')
def test_endpoint_type(self, mock):
self.shell('--os-mistral-endpoint-type=adminURL workbook-list')
self.assertTrue(mock.called)
params = mock.call_args
self.assertEqual(params[1]['endpoint_type'], 'adminURL')
self.assertEqual('adminURL', params[1]['endpoint_type'])
@mock.patch('mistralclient.api.client.client')
def test_no_endpoint_type(self, mock):
self.shell('workbook-list')
self.assertTrue(mock.called)
params = mock.call_args
self.assertEqual(params[1]['endpoint_type'], 'publicURL')
self.assertEqual('publicURL', params[1]['endpoint_type'])

View File

@ -116,7 +116,7 @@ class TestCLIWorkbooksV2(base.BaseCommandTest):
result = self.call(workbook_cmd.Validate, app_args=['wb.yaml'])
self.assertEqual(result[1], (True, None))
self.assertEqual((True, None), result[1])
@mock.patch('argparse.open', create=True)
@mock.patch('mistralclient.api.v2.workbooks.WorkbookManager.validate')

View File

@ -159,7 +159,7 @@ class TestCLIWorkflowsV2(base.BaseCommandTest):
result = self.call(workflow_cmd.Validate, app_args=['wf.yaml'])
self.assertEqual(result[1], (True, None))
self.assertEqual((True, None), result[1])
@mock.patch('argparse.open', create=True)
@mock.patch('mistralclient.api.v2.workflows.WorkflowManager.validate')