Merge "fix the wrong order of assertEqual args"
This commit is contained in:
commit
2c03f6f42f
@ -55,22 +55,22 @@ class TestCommandManager(utils.TestCase):
|
||||
mock_cmd_one = mock.Mock()
|
||||
mgr.add_command('mock', mock_cmd_one)
|
||||
cmd_mock, name, args = mgr.find_command(['mock'])
|
||||
self.assertEqual(cmd_mock, mock_cmd_one)
|
||||
self.assertEqual(mock_cmd_one, cmd_mock)
|
||||
|
||||
# Find a command added in initialization
|
||||
cmd_one, name, args = mgr.find_command(['one'])
|
||||
self.assertEqual(cmd_one, FAKE_CMD_ONE)
|
||||
self.assertEqual(FAKE_CMD_ONE, cmd_one)
|
||||
|
||||
# Load another command group
|
||||
mgr.add_command_group('greek')
|
||||
|
||||
# Find a new command
|
||||
cmd_alpha, name, args = mgr.find_command(['alpha'])
|
||||
self.assertEqual(cmd_alpha, FAKE_CMD_ALPHA)
|
||||
self.assertEqual(FAKE_CMD_ALPHA, cmd_alpha)
|
||||
|
||||
# Ensure that the original commands were not overwritten
|
||||
cmd_two, name, args = mgr.find_command(['two'])
|
||||
self.assertEqual(cmd_two, FAKE_CMD_TWO)
|
||||
self.assertEqual(FAKE_CMD_TWO, cmd_two)
|
||||
|
||||
def test_get_command_groups(self):
|
||||
mgr = FakeCommandManager('test')
|
||||
@ -79,7 +79,7 @@ class TestCommandManager(utils.TestCase):
|
||||
mock_cmd_one = mock.Mock()
|
||||
mgr.add_command('mock', mock_cmd_one)
|
||||
cmd_mock, name, args = mgr.find_command(['mock'])
|
||||
self.assertEqual(cmd_mock, mock_cmd_one)
|
||||
self.assertEqual(mock_cmd_one, cmd_mock)
|
||||
|
||||
# Load another command group
|
||||
mgr.add_command_group('greek')
|
||||
|
@ -75,7 +75,7 @@ class TestExtensionList(TestExtension):
|
||||
self.identity_extensions_mock.list.assert_called_with()
|
||||
|
||||
collist = ('Name', 'Alias', 'Description')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
(
|
||||
identity_fakes.extension_name,
|
||||
@ -88,7 +88,7 @@ class TestExtensionList(TestExtension):
|
||||
network_fakes.extension_description,
|
||||
),
|
||||
)
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
def test_extension_list_long(self):
|
||||
arglist = [
|
||||
@ -107,7 +107,7 @@ class TestExtensionList(TestExtension):
|
||||
|
||||
collist = ('Name', 'Namespace', 'Description', 'Alias', 'Updated',
|
||||
'Links')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
(
|
||||
identity_fakes.extension_name,
|
||||
@ -126,7 +126,7 @@ class TestExtensionList(TestExtension):
|
||||
network_fakes.extension_links,
|
||||
),
|
||||
)
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
def test_extension_list_identity(self):
|
||||
arglist = [
|
||||
@ -143,13 +143,13 @@ class TestExtensionList(TestExtension):
|
||||
self.identity_extensions_mock.list.assert_called_with()
|
||||
|
||||
collist = ('Name', 'Alias', 'Description')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.extension_name,
|
||||
identity_fakes.extension_alias,
|
||||
identity_fakes.extension_description,
|
||||
), )
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
def test_extension_list_network(self):
|
||||
arglist = [
|
||||
@ -165,7 +165,7 @@ class TestExtensionList(TestExtension):
|
||||
self.network_extensions_mock.assert_called_with()
|
||||
|
||||
collist = ('Name', 'Alias', 'Description')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
(
|
||||
network_fakes.extension_name,
|
||||
@ -173,4 +173,4 @@ class TestExtensionList(TestExtension):
|
||||
network_fakes.extension_description,
|
||||
),
|
||||
)
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
@ -101,4 +101,4 @@ class TestKeyValueAction(utils.TestCase):
|
||||
# There should be no red or blue
|
||||
expect = {'green': '100%'}
|
||||
self.assertDictEqual(expect, actual)
|
||||
self.assertEqual(failhere, None)
|
||||
self.assertEqual(None, failhere)
|
||||
|
@ -31,7 +31,7 @@ class TestUtils(test_utils.TestCase):
|
||||
mock_stdin = mock.Mock()
|
||||
mock_stdin.isatty = mock.Mock()
|
||||
mock_stdin.isatty.return_value = True
|
||||
self.assertEqual(utils.get_password(mock_stdin), PASSWORD)
|
||||
self.assertEqual(PASSWORD, utils.get_password(mock_stdin))
|
||||
|
||||
def test_get_password_bad_once(self):
|
||||
answers = [PASSWORD, WASSPORD, DROWSSAP, DROWSSAP]
|
||||
@ -39,7 +39,7 @@ class TestUtils(test_utils.TestCase):
|
||||
mock_stdin = mock.Mock()
|
||||
mock_stdin.isatty = mock.Mock()
|
||||
mock_stdin.isatty.return_value = True
|
||||
self.assertEqual(utils.get_password(mock_stdin), DROWSSAP)
|
||||
self.assertEqual(DROWSSAP, utils.get_password(mock_stdin))
|
||||
|
||||
def test_get_password_no_tty(self):
|
||||
mock_stdin = mock.Mock()
|
||||
|
@ -84,7 +84,7 @@ class TestEndpointCreate(TestEndpoint):
|
||||
|
||||
collist = ('adminurl', 'id', 'internalurl', 'publicurl',
|
||||
'region', 'service_id', 'service_name', 'service_type')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.endpoint_adminurl,
|
||||
identity_fakes.endpoint_id,
|
||||
@ -96,7 +96,7 @@ class TestEndpointCreate(TestEndpoint):
|
||||
identity_fakes.service_type,
|
||||
)
|
||||
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
|
||||
class TestEndpointDelete(TestEndpoint):
|
||||
@ -171,14 +171,14 @@ class TestEndpointList(TestEndpoint):
|
||||
self.endpoints_mock.list.assert_called_with()
|
||||
|
||||
collist = ('ID', 'Region', 'Service Name', 'Service Type')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.endpoint_id,
|
||||
identity_fakes.endpoint_region,
|
||||
identity_fakes.service_name,
|
||||
identity_fakes.service_type,
|
||||
), )
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
def test_endpoint_list_long(self):
|
||||
arglist = [
|
||||
@ -196,7 +196,7 @@ class TestEndpointList(TestEndpoint):
|
||||
|
||||
collist = ('ID', 'Region', 'Service Name', 'Service Type',
|
||||
'PublicURL', 'AdminURL', 'InternalURL')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.endpoint_id,
|
||||
identity_fakes.endpoint_region,
|
||||
@ -206,7 +206,7 @@ class TestEndpointList(TestEndpoint):
|
||||
identity_fakes.endpoint_adminurl,
|
||||
identity_fakes.endpoint_internalurl,
|
||||
), )
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
|
||||
class TestEndpointShow(TestEndpoint):
|
||||
@ -252,7 +252,7 @@ class TestEndpointShow(TestEndpoint):
|
||||
|
||||
collist = ('adminurl', 'id', 'internalurl', 'publicurl',
|
||||
'region', 'service_id', 'service_name', 'service_type')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.endpoint_adminurl,
|
||||
identity_fakes.endpoint_id,
|
||||
@ -263,4 +263,4 @@ class TestEndpointShow(TestEndpoint):
|
||||
identity_fakes.service_name,
|
||||
identity_fakes.service_type,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
@ -71,14 +71,14 @@ class TestProjectCreate(TestProject):
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id', 'name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_description,
|
||||
True,
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
def test_project_create_description(self):
|
||||
arglist = [
|
||||
@ -105,14 +105,14 @@ class TestProjectCreate(TestProject):
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id', 'name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_description,
|
||||
True,
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
def test_project_create_enable(self):
|
||||
arglist = [
|
||||
@ -140,14 +140,14 @@ class TestProjectCreate(TestProject):
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id', 'name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_description,
|
||||
True,
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
def test_project_create_disable(self):
|
||||
arglist = [
|
||||
@ -175,14 +175,14 @@ class TestProjectCreate(TestProject):
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id', 'name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_description,
|
||||
True,
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
def test_project_create_property(self):
|
||||
arglist = [
|
||||
@ -212,14 +212,14 @@ class TestProjectCreate(TestProject):
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id', 'name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_description,
|
||||
True,
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
def test_project_create_or_show_exists(self):
|
||||
def _raise_conflict(*args, **kwargs):
|
||||
@ -331,7 +331,7 @@ class TestProjectDelete(TestProject):
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
result = self.cmd.run(parsed_args)
|
||||
self.assertEqual(result, 0)
|
||||
self.assertEqual(0, result)
|
||||
|
||||
self.projects_mock.delete.assert_called_with(
|
||||
identity_fakes.project_id,
|
||||
@ -364,12 +364,12 @@ class TestProjectList(TestProject):
|
||||
self.projects_mock.list.assert_called_with()
|
||||
|
||||
collist = ('ID', 'Name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
), )
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
def test_project_list_long(self):
|
||||
arglist = [
|
||||
@ -385,14 +385,14 @@ class TestProjectList(TestProject):
|
||||
self.projects_mock.list.assert_called_with()
|
||||
|
||||
collist = ('ID', 'Name', 'Description', 'Enabled')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
identity_fakes.project_description,
|
||||
True,
|
||||
), )
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
|
||||
class TestProjectSet(TestProject):
|
||||
@ -426,7 +426,7 @@ class TestProjectSet(TestProject):
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
result = self.cmd.run(parsed_args)
|
||||
self.assertEqual(result, 0)
|
||||
self.assertEqual(0, result)
|
||||
|
||||
def test_project_set_name(self):
|
||||
arglist = [
|
||||
@ -442,7 +442,7 @@ class TestProjectSet(TestProject):
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
result = self.cmd.run(parsed_args)
|
||||
self.assertEqual(result, 0)
|
||||
self.assertEqual(0, result)
|
||||
|
||||
# Set expected values
|
||||
kwargs = {
|
||||
@ -469,7 +469,7 @@ class TestProjectSet(TestProject):
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
result = self.cmd.run(parsed_args)
|
||||
self.assertEqual(result, 0)
|
||||
self.assertEqual(0, result)
|
||||
|
||||
# Set expected values
|
||||
kwargs = {
|
||||
@ -495,7 +495,7 @@ class TestProjectSet(TestProject):
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
result = self.cmd.run(parsed_args)
|
||||
self.assertEqual(result, 0)
|
||||
self.assertEqual(0, result)
|
||||
|
||||
# Set expected values
|
||||
kwargs = {
|
||||
@ -521,7 +521,7 @@ class TestProjectSet(TestProject):
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
result = self.cmd.run(parsed_args)
|
||||
self.assertEqual(result, 0)
|
||||
self.assertEqual(0, result)
|
||||
|
||||
# Set expected values
|
||||
kwargs = {
|
||||
@ -547,7 +547,7 @@ class TestProjectSet(TestProject):
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
result = self.cmd.run(parsed_args)
|
||||
self.assertEqual(result, 0)
|
||||
self.assertEqual(0, result)
|
||||
|
||||
# Set expected values
|
||||
kwargs = {
|
||||
@ -593,11 +593,11 @@ class TestProjectShow(TestProject):
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id', 'name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_description,
|
||||
True,
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
@ -97,12 +97,12 @@ class TestRoleAdd(TestRole):
|
||||
)
|
||||
|
||||
collist = ('id', 'name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.role_name,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
|
||||
class TestRoleCreate(TestRole):
|
||||
@ -137,12 +137,12 @@ class TestRoleCreate(TestRole):
|
||||
)
|
||||
|
||||
collist = ('id', 'name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.role_name,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
def test_role_create_or_show_exists(self):
|
||||
def _raise_conflict(*args, **kwargs):
|
||||
@ -273,12 +273,12 @@ class TestRoleList(TestRole):
|
||||
self.roles_mock.list.assert_called_with()
|
||||
|
||||
collist = ('ID', 'Name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.role_name,
|
||||
), )
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
|
||||
class TestUserRoleList(TestRole):
|
||||
@ -339,14 +339,14 @@ class TestUserRoleList(TestRole):
|
||||
)
|
||||
|
||||
collist = ('ID', 'Name', 'Project', 'User')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.role_name,
|
||||
identity_fakes.project_name,
|
||||
identity_fakes.user_name,
|
||||
), )
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
def test_user_role_list_project(self):
|
||||
self.projects_mock.get.return_value = fakes.FakeResource(
|
||||
@ -396,14 +396,14 @@ class TestUserRoleList(TestRole):
|
||||
)
|
||||
|
||||
collist = ('ID', 'Name', 'Project', 'User')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.role_name,
|
||||
identity_fakes.PROJECT_2['name'],
|
||||
identity_fakes.user_name,
|
||||
), )
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
|
||||
class TestRoleRemove(TestRole):
|
||||
@ -489,9 +489,9 @@ class TestRoleShow(TestRole):
|
||||
)
|
||||
|
||||
collist = ('id', 'name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.role_name,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
@ -67,14 +67,14 @@ class TestServiceCreate(TestService):
|
||||
)
|
||||
|
||||
collist = ('description', 'id', 'name', 'type')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.service_description,
|
||||
identity_fakes.service_id,
|
||||
identity_fakes.service_name,
|
||||
identity_fakes.service_type,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
def test_service_create_with_type_option(self):
|
||||
arglist = [
|
||||
@ -100,14 +100,14 @@ class TestServiceCreate(TestService):
|
||||
)
|
||||
|
||||
collist = ('description', 'id', 'name', 'type')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.service_description,
|
||||
identity_fakes.service_id,
|
||||
identity_fakes.service_name,
|
||||
identity_fakes.service_type,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
def test_service_create_with_name_option(self):
|
||||
arglist = [
|
||||
@ -133,14 +133,14 @@ class TestServiceCreate(TestService):
|
||||
)
|
||||
|
||||
collist = ('description', 'id', 'name', 'type')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.service_description,
|
||||
identity_fakes.service_id,
|
||||
identity_fakes.service_name,
|
||||
identity_fakes.service_type,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
def test_service_create_description(self):
|
||||
arglist = [
|
||||
@ -167,14 +167,14 @@ class TestServiceCreate(TestService):
|
||||
)
|
||||
|
||||
collist = ('description', 'id', 'name', 'type')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.service_description,
|
||||
identity_fakes.service_id,
|
||||
identity_fakes.service_name,
|
||||
identity_fakes.service_type,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
|
||||
class TestServiceDelete(TestService):
|
||||
@ -236,13 +236,13 @@ class TestServiceList(TestService):
|
||||
self.services_mock.list.assert_called_with()
|
||||
|
||||
collist = ('ID', 'Name', 'Type')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.service_id,
|
||||
identity_fakes.service_name,
|
||||
identity_fakes.service_type,
|
||||
), )
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
def test_service_list_long(self):
|
||||
arglist = [
|
||||
@ -259,14 +259,14 @@ class TestServiceList(TestService):
|
||||
self.services_mock.list.assert_called_with()
|
||||
|
||||
collist = ('ID', 'Name', 'Type', 'Description')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.service_id,
|
||||
identity_fakes.service_name,
|
||||
identity_fakes.service_type,
|
||||
identity_fakes.service_description,
|
||||
), )
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
|
||||
class TestServiceShow(TestService):
|
||||
@ -301,11 +301,11 @@ class TestServiceShow(TestService):
|
||||
)
|
||||
|
||||
collist = ('description', 'id', 'name', 'type')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.service_description,
|
||||
identity_fakes.service_id,
|
||||
identity_fakes.service_name,
|
||||
identity_fakes.service_type,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
@ -49,14 +49,14 @@ class TestTokenIssue(TestToken):
|
||||
self.sc_mock.get_token.assert_called_with()
|
||||
|
||||
collist = ('expires', 'id', 'project_id', 'user_id')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.token_expires,
|
||||
identity_fakes.token_id,
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.user_id,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
|
||||
class TestTokenRevoke(TestToken):
|
||||
|
@ -586,7 +586,7 @@ class TestUserSet(TestUser):
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
result = self.cmd.run(parsed_args)
|
||||
self.assertEqual(result, 0)
|
||||
self.assertEqual(0, result)
|
||||
|
||||
def test_user_set_name(self):
|
||||
arglist = [
|
||||
|
@ -54,13 +54,13 @@ class TestConsumerCreate(TestOAuth1):
|
||||
)
|
||||
|
||||
collist = ('description', 'id', 'secret')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.consumer_description,
|
||||
identity_fakes.consumer_id,
|
||||
identity_fakes.consumer_secret,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
|
||||
class TestConsumerDelete(TestOAuth1):
|
||||
@ -88,7 +88,7 @@ class TestConsumerDelete(TestOAuth1):
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
result = self.cmd.run(parsed_args)
|
||||
self.assertEqual(result, 0)
|
||||
self.assertEqual(0, result)
|
||||
|
||||
self.consumers_mock.delete.assert_called_with(
|
||||
identity_fakes.consumer_id,
|
||||
@ -126,12 +126,12 @@ class TestConsumerList(TestOAuth1):
|
||||
self.consumers_mock.list.assert_called_with()
|
||||
|
||||
collist = ('ID', 'Description')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.consumer_id,
|
||||
identity_fakes.consumer_description,
|
||||
), )
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
|
||||
class TestConsumerShow(TestOAuth1):
|
||||
@ -165,12 +165,12 @@ class TestConsumerShow(TestOAuth1):
|
||||
)
|
||||
|
||||
collist = ('description', 'id')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.consumer_description,
|
||||
identity_fakes.consumer_id,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
|
||||
class TestConsumerSet(TestOAuth1):
|
||||
@ -207,7 +207,7 @@ class TestConsumerSet(TestOAuth1):
|
||||
]
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
result = self.cmd.run(parsed_args)
|
||||
self.assertEqual(result, 0)
|
||||
self.assertEqual(0, result)
|
||||
|
||||
kwargs = {'description': new_description}
|
||||
self.consumers_mock.update.assert_called_with(
|
||||
|
@ -88,7 +88,7 @@ class TestGroupList(TestGroup):
|
||||
)
|
||||
|
||||
collist = ('ID', 'Name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.group_id,
|
||||
identity_fakes.group_name,
|
||||
@ -118,7 +118,7 @@ class TestGroupList(TestGroup):
|
||||
)
|
||||
|
||||
collist = ('ID', 'Name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.group_id,
|
||||
identity_fakes.group_name,
|
||||
@ -148,7 +148,7 @@ class TestGroupList(TestGroup):
|
||||
)
|
||||
|
||||
collist = ('ID', 'Name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.group_id,
|
||||
identity_fakes.group_name,
|
||||
@ -183,7 +183,7 @@ class TestGroupList(TestGroup):
|
||||
'Domain ID',
|
||||
'Description',
|
||||
)
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.group_id,
|
||||
identity_fakes.group_name,
|
||||
|
@ -61,13 +61,13 @@ class TestIdentityProviderCreate(TestIdentityProvider):
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.idp_description,
|
||||
True,
|
||||
identity_fakes.idp_id,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
def test_create_identity_provider_description(self):
|
||||
arglist = [
|
||||
@ -93,13 +93,13 @@ class TestIdentityProviderCreate(TestIdentityProvider):
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.idp_description,
|
||||
True,
|
||||
identity_fakes.idp_id,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
def test_create_identity_provider_disabled(self):
|
||||
|
||||
@ -133,13 +133,13 @@ class TestIdentityProviderCreate(TestIdentityProvider):
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
None,
|
||||
False,
|
||||
identity_fakes.idp_id,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
|
||||
class TestIdentityProviderDelete(TestIdentityProvider):
|
||||
@ -203,13 +203,13 @@ class TestIdentityProviderList(TestIdentityProvider):
|
||||
self.identity_providers_mock.list.assert_called_with()
|
||||
|
||||
collist = ('ID', 'Enabled', 'Description')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.idp_id,
|
||||
True,
|
||||
identity_fakes.idp_description,
|
||||
), )
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
|
||||
class TestIdentityProviderShow(TestIdentityProvider):
|
||||
@ -242,13 +242,13 @@ class TestIdentityProviderShow(TestIdentityProvider):
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.idp_description,
|
||||
True,
|
||||
identity_fakes.idp_id,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
|
||||
class TestIdentityProviderSet(TestIdentityProvider):
|
||||
@ -291,7 +291,7 @@ class TestIdentityProviderSet(TestIdentityProvider):
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.idp_description,
|
||||
False,
|
||||
@ -328,13 +328,13 @@ class TestIdentityProviderSet(TestIdentityProvider):
|
||||
self.identity_providers_mock.update.assert_called_with(
|
||||
identity_fakes.idp_id, enabled=True)
|
||||
collist = ('description', 'enabled', 'id')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.idp_description,
|
||||
True,
|
||||
identity_fakes.idp_id,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
def test_identity_provider_no_options(self):
|
||||
def prepare(self):
|
||||
@ -368,5 +368,5 @@ class TestIdentityProviderSet(TestIdentityProvider):
|
||||
|
||||
# expect take_action() to return (None, None) as
|
||||
# neither --enable nor --disable was specified
|
||||
self.assertEqual(columns, None)
|
||||
self.assertEqual(data, None)
|
||||
self.assertEqual(None, columns)
|
||||
self.assertEqual(None, data)
|
||||
|
@ -65,7 +65,7 @@ class TestMappingCreate(TestMapping):
|
||||
rules=identity_fakes.MAPPING_RULES)
|
||||
|
||||
collist = ('id', 'rules')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
|
||||
datalist = (identity_fakes.mapping_id,
|
||||
identity_fakes.MAPPING_RULES)
|
||||
@ -134,7 +134,7 @@ class TestMappingList(TestMapping):
|
||||
self.mapping_mock.list.assert_called_with()
|
||||
|
||||
collist = ('ID',)
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
|
||||
datalist = [(identity_fakes.mapping_id,), ('extra_mapping',)]
|
||||
self.assertEqual(datalist, data)
|
||||
@ -167,7 +167,7 @@ class TestMappingShow(TestMapping):
|
||||
identity_fakes.mapping_id)
|
||||
|
||||
collist = ('id', 'rules')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
|
||||
datalist = (identity_fakes.mapping_id,
|
||||
identity_fakes.MAPPING_RULES)
|
||||
@ -216,7 +216,7 @@ class TestMappingSet(TestMapping):
|
||||
rules=identity_fakes.MAPPING_RULES_2)
|
||||
|
||||
collist = ('id', 'rules')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (identity_fakes.mapping_id,
|
||||
identity_fakes.MAPPING_RULES_2)
|
||||
self.assertEqual(datalist, data)
|
||||
|
@ -72,14 +72,14 @@ class TestRequestTokenCreate(TestOAuth1):
|
||||
)
|
||||
|
||||
collist = ('expires', 'id', 'key', 'secret')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.request_token_expires,
|
||||
identity_fakes.request_token_id,
|
||||
identity_fakes.request_token_id,
|
||||
identity_fakes.request_token_secret,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
|
||||
class TestRequestTokenAuthorize(TestOAuth1):
|
||||
@ -116,11 +116,11 @@ class TestRequestTokenAuthorize(TestOAuth1):
|
||||
)
|
||||
|
||||
collist = ('oauth_verifier',)
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.oauth_verifier_pin,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
|
||||
class TestAccessTokenCreate(TestOAuth1):
|
||||
@ -163,11 +163,11 @@ class TestAccessTokenCreate(TestOAuth1):
|
||||
)
|
||||
|
||||
collist = ('expires', 'id', 'key', 'secret')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.access_token_expires,
|
||||
identity_fakes.access_token_id,
|
||||
identity_fakes.access_token_id,
|
||||
identity_fakes.access_token_secret,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
@ -83,7 +83,7 @@ class TestProjectCreate(TestProject):
|
||||
)
|
||||
|
||||
collist = ('description', 'domain_id', 'enabled', 'id', 'name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_description,
|
||||
identity_fakes.domain_id,
|
||||
@ -91,7 +91,7 @@ class TestProjectCreate(TestProject):
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
def test_project_create_description(self):
|
||||
arglist = [
|
||||
@ -123,7 +123,7 @@ class TestProjectCreate(TestProject):
|
||||
)
|
||||
|
||||
collist = ('description', 'domain_id', 'enabled', 'id', 'name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_description,
|
||||
identity_fakes.domain_id,
|
||||
@ -131,7 +131,7 @@ class TestProjectCreate(TestProject):
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
def test_project_create_domain(self):
|
||||
arglist = [
|
||||
@ -163,7 +163,7 @@ class TestProjectCreate(TestProject):
|
||||
)
|
||||
|
||||
collist = ('description', 'domain_id', 'enabled', 'id', 'name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_description,
|
||||
identity_fakes.domain_id,
|
||||
@ -171,7 +171,7 @@ class TestProjectCreate(TestProject):
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
def test_project_create_domain_no_perms(self):
|
||||
arglist = [
|
||||
@ -202,7 +202,7 @@ class TestProjectCreate(TestProject):
|
||||
**kwargs
|
||||
)
|
||||
collist = ('description', 'domain_id', 'enabled', 'id', 'name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_description,
|
||||
identity_fakes.domain_id,
|
||||
@ -210,7 +210,7 @@ class TestProjectCreate(TestProject):
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
def test_project_create_enable(self):
|
||||
arglist = [
|
||||
@ -241,7 +241,7 @@ class TestProjectCreate(TestProject):
|
||||
)
|
||||
|
||||
collist = ('description', 'domain_id', 'enabled', 'id', 'name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_description,
|
||||
identity_fakes.domain_id,
|
||||
@ -249,7 +249,7 @@ class TestProjectCreate(TestProject):
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
def test_project_create_disable(self):
|
||||
arglist = [
|
||||
@ -280,7 +280,7 @@ class TestProjectCreate(TestProject):
|
||||
)
|
||||
|
||||
collist = ('description', 'domain_id', 'enabled', 'id', 'name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_description,
|
||||
identity_fakes.domain_id,
|
||||
@ -288,7 +288,7 @@ class TestProjectCreate(TestProject):
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
def test_project_create_property(self):
|
||||
arglist = [
|
||||
@ -321,7 +321,7 @@ class TestProjectCreate(TestProject):
|
||||
)
|
||||
|
||||
collist = ('description', 'domain_id', 'enabled', 'id', 'name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_description,
|
||||
identity_fakes.domain_id,
|
||||
@ -329,7 +329,7 @@ class TestProjectCreate(TestProject):
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
|
||||
class TestProjectDelete(TestProject):
|
||||
@ -358,7 +358,7 @@ class TestProjectDelete(TestProject):
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
result = self.cmd.run(parsed_args)
|
||||
self.assertEqual(result, 0)
|
||||
self.assertEqual(0, result)
|
||||
|
||||
self.projects_mock.delete.assert_called_with(
|
||||
identity_fakes.project_id,
|
||||
@ -391,12 +391,12 @@ class TestProjectList(TestProject):
|
||||
self.projects_mock.list.assert_called_with()
|
||||
|
||||
collist = ('ID', 'Name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
), )
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
def test_project_list_long(self):
|
||||
arglist = [
|
||||
@ -412,7 +412,7 @@ class TestProjectList(TestProject):
|
||||
self.projects_mock.list.assert_called_with()
|
||||
|
||||
collist = ('ID', 'Name', 'Domain ID', 'Description', 'Enabled')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
@ -420,7 +420,7 @@ class TestProjectList(TestProject):
|
||||
identity_fakes.project_description,
|
||||
True,
|
||||
), )
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
def test_project_list_domain(self):
|
||||
arglist = [
|
||||
@ -444,12 +444,12 @@ class TestProjectList(TestProject):
|
||||
domain=identity_fakes.domain_id)
|
||||
|
||||
collist = ('ID', 'Name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
), )
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
def test_project_list_domain_no_perms(self):
|
||||
arglist = [
|
||||
@ -468,12 +468,12 @@ class TestProjectList(TestProject):
|
||||
self.projects_mock.list.assert_called_with(
|
||||
domain=identity_fakes.domain_id)
|
||||
collist = ('ID', 'Name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
), )
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
|
||||
class TestProjectSet(TestProject):
|
||||
@ -513,7 +513,7 @@ class TestProjectSet(TestProject):
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
result = self.cmd.run(parsed_args)
|
||||
self.assertEqual(result, 0)
|
||||
self.assertEqual(0, result)
|
||||
|
||||
def test_project_set_name(self):
|
||||
arglist = [
|
||||
@ -529,7 +529,7 @@ class TestProjectSet(TestProject):
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
result = self.cmd.run(parsed_args)
|
||||
self.assertEqual(result, 0)
|
||||
self.assertEqual(0, result)
|
||||
|
||||
# Set expected values
|
||||
kwargs = {
|
||||
@ -556,7 +556,7 @@ class TestProjectSet(TestProject):
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
result = self.cmd.run(parsed_args)
|
||||
self.assertEqual(result, 0)
|
||||
self.assertEqual(0, result)
|
||||
|
||||
# Set expected values
|
||||
kwargs = {
|
||||
@ -580,7 +580,7 @@ class TestProjectSet(TestProject):
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
result = self.cmd.run(parsed_args)
|
||||
self.assertEqual(result, 0)
|
||||
self.assertEqual(0, result)
|
||||
|
||||
# Set expected values
|
||||
kwargs = {
|
||||
@ -604,7 +604,7 @@ class TestProjectSet(TestProject):
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
result = self.cmd.run(parsed_args)
|
||||
self.assertEqual(result, 0)
|
||||
self.assertEqual(0, result)
|
||||
|
||||
# Set expected values
|
||||
kwargs = {
|
||||
@ -628,7 +628,7 @@ class TestProjectSet(TestProject):
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
result = self.cmd.run(parsed_args)
|
||||
self.assertEqual(result, 0)
|
||||
self.assertEqual(0, result)
|
||||
|
||||
# Set expected values
|
||||
kwargs = {
|
||||
@ -671,7 +671,7 @@ class TestProjectShow(TestProject):
|
||||
)
|
||||
|
||||
collist = ('description', 'domain_id', 'enabled', 'id', 'name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_description,
|
||||
identity_fakes.domain_id,
|
||||
@ -679,4 +679,4 @@ class TestProjectShow(TestProject):
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
@ -105,7 +105,7 @@ class TestRoleAdd(TestRole):
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
result = self.cmd.run(parsed_args)
|
||||
self.assertEqual(result, 0)
|
||||
self.assertEqual(0, result)
|
||||
|
||||
# Set expected values
|
||||
kwargs = {
|
||||
@ -134,7 +134,7 @@ class TestRoleAdd(TestRole):
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
result = self.cmd.run(parsed_args)
|
||||
self.assertEqual(result, 0)
|
||||
self.assertEqual(0, result)
|
||||
|
||||
# Set expected values
|
||||
kwargs = {
|
||||
@ -163,7 +163,7 @@ class TestRoleAdd(TestRole):
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
result = self.cmd.run(parsed_args)
|
||||
self.assertEqual(result, 0)
|
||||
self.assertEqual(0, result)
|
||||
|
||||
# Set expected values
|
||||
kwargs = {
|
||||
@ -192,7 +192,7 @@ class TestRoleAdd(TestRole):
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
result = self.cmd.run(parsed_args)
|
||||
self.assertEqual(result, 0)
|
||||
self.assertEqual(0, result)
|
||||
|
||||
# Set expected values
|
||||
kwargs = {
|
||||
@ -243,12 +243,12 @@ class TestRoleCreate(TestRole):
|
||||
)
|
||||
|
||||
collist = ('id', 'name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.role_name,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
|
||||
class TestRoleDelete(TestRole):
|
||||
@ -331,12 +331,12 @@ class TestRoleList(TestRole):
|
||||
self.roles_mock.list.assert_called_with()
|
||||
|
||||
collist = ('ID', 'Name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.role_name,
|
||||
), )
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
def test_user_list_user(self):
|
||||
arglist = [
|
||||
@ -361,12 +361,12 @@ class TestRoleList(TestRole):
|
||||
)
|
||||
|
||||
collist = ('ID', 'Name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.role_name,
|
||||
), )
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
def test_role_list_domain_user(self):
|
||||
arglist = [
|
||||
@ -393,14 +393,14 @@ class TestRoleList(TestRole):
|
||||
)
|
||||
|
||||
collist = ('ID', 'Name', 'Domain', 'User')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.role_name,
|
||||
identity_fakes.domain_name,
|
||||
identity_fakes.user_name,
|
||||
), )
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
def test_role_list_domain_group(self):
|
||||
arglist = [
|
||||
@ -427,14 +427,14 @@ class TestRoleList(TestRole):
|
||||
)
|
||||
|
||||
collist = ('ID', 'Name', 'Domain', 'Group')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.role_name,
|
||||
identity_fakes.domain_name,
|
||||
identity_fakes.group_name,
|
||||
), )
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
def test_role_list_project_user(self):
|
||||
arglist = [
|
||||
@ -461,14 +461,14 @@ class TestRoleList(TestRole):
|
||||
)
|
||||
|
||||
collist = ('ID', 'Name', 'Project', 'User')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.role_name,
|
||||
identity_fakes.project_name,
|
||||
identity_fakes.user_name,
|
||||
), )
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
def test_role_list_project_group(self):
|
||||
arglist = [
|
||||
@ -495,14 +495,14 @@ class TestRoleList(TestRole):
|
||||
)
|
||||
|
||||
collist = ('ID', 'Name', 'Project', 'Group')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.role_name,
|
||||
identity_fakes.project_name,
|
||||
identity_fakes.group_name,
|
||||
), )
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
|
||||
class TestRoleRemove(TestRole):
|
||||
@ -733,9 +733,9 @@ class TestRoleShow(TestRole):
|
||||
)
|
||||
|
||||
collist = ('id', 'name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.role_name,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
@ -89,7 +89,7 @@ class TestRoleAssignmentList(TestRoleAssignment):
|
||||
project=None)
|
||||
|
||||
collist = ('Role', 'User', 'Group', 'Project', 'Domain')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.user_id,
|
||||
@ -102,7 +102,7 @@ class TestRoleAssignmentList(TestRoleAssignment):
|
||||
identity_fakes.project_id,
|
||||
''
|
||||
),)
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
def test_role_assignment_list_user(self):
|
||||
|
||||
@ -146,7 +146,7 @@ class TestRoleAssignmentList(TestRoleAssignment):
|
||||
effective=False)
|
||||
|
||||
collist = ('Role', 'User', 'Group', 'Project', 'Domain')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.user_id,
|
||||
@ -159,7 +159,7 @@ class TestRoleAssignmentList(TestRoleAssignment):
|
||||
identity_fakes.project_id,
|
||||
''
|
||||
),)
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
def test_role_assignment_list_group(self):
|
||||
|
||||
@ -203,7 +203,7 @@ class TestRoleAssignmentList(TestRoleAssignment):
|
||||
user=None)
|
||||
|
||||
collist = ('Role', 'User', 'Group', 'Project', 'Domain')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.role_id,
|
||||
'',
|
||||
@ -216,7 +216,7 @@ class TestRoleAssignmentList(TestRoleAssignment):
|
||||
identity_fakes.project_id,
|
||||
''
|
||||
),)
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
def test_role_assignment_list_domain(self):
|
||||
|
||||
@ -260,7 +260,7 @@ class TestRoleAssignmentList(TestRoleAssignment):
|
||||
user=None)
|
||||
|
||||
collist = ('Role', 'User', 'Group', 'Project', 'Domain')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.user_id,
|
||||
@ -273,7 +273,7 @@ class TestRoleAssignmentList(TestRoleAssignment):
|
||||
'',
|
||||
identity_fakes.domain_id
|
||||
),)
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
def test_role_assignment_list_project(self):
|
||||
|
||||
@ -317,7 +317,7 @@ class TestRoleAssignmentList(TestRoleAssignment):
|
||||
user=None)
|
||||
|
||||
collist = ('Role', 'User', 'Group', 'Project', 'Domain')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.user_id,
|
||||
@ -330,7 +330,7 @@ class TestRoleAssignmentList(TestRoleAssignment):
|
||||
identity_fakes.project_id,
|
||||
''
|
||||
),)
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
def test_role_assignment_list_effective(self):
|
||||
|
||||
@ -372,7 +372,7 @@ class TestRoleAssignmentList(TestRoleAssignment):
|
||||
user=None)
|
||||
|
||||
collist = ('Role', 'User', 'Group', 'Project', 'Domain')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.user_id,
|
||||
@ -385,4 +385,4 @@ class TestRoleAssignmentList(TestRoleAssignment):
|
||||
'',
|
||||
identity_fakes.domain_id,
|
||||
),)
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
@ -70,7 +70,7 @@ class TestServiceCreate(TestService):
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id', 'name', 'type')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.service_description,
|
||||
True,
|
||||
@ -78,7 +78,7 @@ class TestServiceCreate(TestService):
|
||||
identity_fakes.service_name,
|
||||
identity_fakes.service_type,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
def test_service_create_description(self):
|
||||
arglist = [
|
||||
@ -106,7 +106,7 @@ class TestServiceCreate(TestService):
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id', 'name', 'type')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.service_description,
|
||||
True,
|
||||
@ -114,7 +114,7 @@ class TestServiceCreate(TestService):
|
||||
identity_fakes.service_name,
|
||||
identity_fakes.service_type,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
def test_service_create_enable(self):
|
||||
arglist = [
|
||||
@ -142,7 +142,7 @@ class TestServiceCreate(TestService):
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id', 'name', 'type')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.service_description,
|
||||
True,
|
||||
@ -150,7 +150,7 @@ class TestServiceCreate(TestService):
|
||||
identity_fakes.service_name,
|
||||
identity_fakes.service_type,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
def test_service_create_disable(self):
|
||||
arglist = [
|
||||
@ -178,7 +178,7 @@ class TestServiceCreate(TestService):
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id', 'name', 'type')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.service_description,
|
||||
True,
|
||||
@ -186,7 +186,7 @@ class TestServiceCreate(TestService):
|
||||
identity_fakes.service_name,
|
||||
identity_fakes.service_type,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
|
||||
class TestServiceDelete(TestService):
|
||||
@ -214,7 +214,7 @@ class TestServiceDelete(TestService):
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
result = self.cmd.run(parsed_args)
|
||||
self.assertEqual(result, 0)
|
||||
self.assertEqual(0, result)
|
||||
|
||||
self.services_mock.delete.assert_called_with(
|
||||
identity_fakes.service_id,
|
||||
@ -248,13 +248,13 @@ class TestServiceList(TestService):
|
||||
self.services_mock.list.assert_called_with()
|
||||
|
||||
collist = ('ID', 'Name', 'Type')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.service_id,
|
||||
identity_fakes.service_name,
|
||||
identity_fakes.service_type,
|
||||
), )
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
def test_service_list_long(self):
|
||||
arglist = [
|
||||
@ -271,7 +271,7 @@ class TestServiceList(TestService):
|
||||
self.services_mock.list.assert_called_with()
|
||||
|
||||
collist = ('ID', 'Name', 'Type', 'Description', 'Enabled')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.service_id,
|
||||
identity_fakes.service_name,
|
||||
@ -279,7 +279,7 @@ class TestServiceList(TestService):
|
||||
identity_fakes.service_description,
|
||||
True,
|
||||
), )
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
|
||||
class TestServiceSet(TestService):
|
||||
@ -316,7 +316,7 @@ class TestServiceSet(TestService):
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
result = self.cmd.run(parsed_args)
|
||||
self.assertEqual(result, 0)
|
||||
self.assertEqual(0, result)
|
||||
|
||||
def test_service_set_type(self):
|
||||
arglist = [
|
||||
@ -334,7 +334,7 @@ class TestServiceSet(TestService):
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
result = self.cmd.run(parsed_args)
|
||||
self.assertEqual(result, 0)
|
||||
self.assertEqual(0, result)
|
||||
|
||||
# Set expected values
|
||||
kwargs = {
|
||||
@ -362,7 +362,7 @@ class TestServiceSet(TestService):
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
result = self.cmd.run(parsed_args)
|
||||
self.assertEqual(result, 0)
|
||||
self.assertEqual(0, result)
|
||||
|
||||
# Set expected values
|
||||
kwargs = {
|
||||
@ -390,7 +390,7 @@ class TestServiceSet(TestService):
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
result = self.cmd.run(parsed_args)
|
||||
self.assertEqual(result, 0)
|
||||
self.assertEqual(0, result)
|
||||
|
||||
# Set expected values
|
||||
kwargs = {
|
||||
@ -418,7 +418,7 @@ class TestServiceSet(TestService):
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
result = self.cmd.run(parsed_args)
|
||||
self.assertEqual(result, 0)
|
||||
self.assertEqual(0, result)
|
||||
|
||||
# Set expected values
|
||||
kwargs = {
|
||||
@ -446,7 +446,7 @@ class TestServiceSet(TestService):
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
result = self.cmd.run(parsed_args)
|
||||
self.assertEqual(result, 0)
|
||||
self.assertEqual(0, result)
|
||||
|
||||
# Set expected values
|
||||
kwargs = {
|
||||
@ -491,7 +491,7 @@ class TestServiceShow(TestService):
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id', 'name', 'type')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.service_description,
|
||||
True,
|
||||
@ -499,4 +499,4 @@ class TestServiceShow(TestService):
|
||||
identity_fakes.service_name,
|
||||
identity_fakes.service_type,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
@ -50,14 +50,14 @@ class TestTokenIssue(TestToken):
|
||||
self.sc_mock.get_token.assert_called_with()
|
||||
|
||||
collist = ('expires', 'id', 'project_id', 'user_id')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.token_expires,
|
||||
identity_fakes.token_id,
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.user_id,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
def test_token_issue_with_domain_id(self):
|
||||
arglist = []
|
||||
@ -72,11 +72,11 @@ class TestTokenIssue(TestToken):
|
||||
self.sc_mock.get_token.assert_called_with()
|
||||
|
||||
collist = ('domain_id', 'expires', 'id', 'user_id')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.domain_id,
|
||||
identity_fakes.token_expires,
|
||||
identity_fakes.token_id,
|
||||
identity_fakes.user_id,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
@ -58,14 +58,14 @@ class TestProjectList(TestUnscopedSAML):
|
||||
self.projects_mock.list.assert_called_with()
|
||||
|
||||
collist = ('ID', 'Domain ID', 'Enabled', 'Name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.domain_id,
|
||||
True,
|
||||
identity_fakes.project_name,
|
||||
), )
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
def test_accessible_projects_list_wrong_auth(self):
|
||||
auth = identity_fakes.FakeAuth("wrong auth")
|
||||
@ -107,14 +107,14 @@ class TestDomainList(TestUnscopedSAML):
|
||||
self.domains_mock.list.assert_called_with()
|
||||
|
||||
collist = ('ID', 'Enabled', 'Name', 'Description')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.domain_id,
|
||||
True,
|
||||
identity_fakes.domain_name,
|
||||
identity_fakes.domain_description,
|
||||
), )
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
def test_accessible_domains_list_wrong_auth(self):
|
||||
auth = identity_fakes.FakeAuth("wrong auth")
|
||||
|
@ -109,7 +109,7 @@ class TestUserCreate(TestUser):
|
||||
|
||||
collist = ('default_project_id', 'domain_id', 'email',
|
||||
'enabled', 'id', 'name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.domain_id,
|
||||
@ -118,7 +118,7 @@ class TestUserCreate(TestUser):
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
def test_user_create_password(self):
|
||||
arglist = [
|
||||
@ -155,7 +155,7 @@ class TestUserCreate(TestUser):
|
||||
|
||||
collist = ('default_project_id', 'domain_id', 'email',
|
||||
'enabled', 'id', 'name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.domain_id,
|
||||
@ -164,7 +164,7 @@ class TestUserCreate(TestUser):
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
def test_user_create_password_prompt(self):
|
||||
arglist = [
|
||||
@ -204,7 +204,7 @@ class TestUserCreate(TestUser):
|
||||
|
||||
collist = ('default_project_id', 'domain_id', 'email',
|
||||
'enabled', 'id', 'name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.domain_id,
|
||||
@ -213,7 +213,7 @@ class TestUserCreate(TestUser):
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
def test_user_create_email(self):
|
||||
arglist = [
|
||||
@ -249,7 +249,7 @@ class TestUserCreate(TestUser):
|
||||
|
||||
collist = ('default_project_id', 'domain_id', 'email',
|
||||
'enabled', 'id', 'name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.domain_id,
|
||||
@ -258,7 +258,7 @@ class TestUserCreate(TestUser):
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
def test_user_create_project(self):
|
||||
# Return the new project
|
||||
@ -309,7 +309,7 @@ class TestUserCreate(TestUser):
|
||||
|
||||
collist = ('default_project_id', 'domain_id', 'email',
|
||||
'enabled', 'id', 'name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.PROJECT_2['id'],
|
||||
identity_fakes.domain_id,
|
||||
@ -318,7 +318,7 @@ class TestUserCreate(TestUser):
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
def test_user_create_domain(self):
|
||||
arglist = [
|
||||
@ -354,7 +354,7 @@ class TestUserCreate(TestUser):
|
||||
|
||||
collist = ('default_project_id', 'domain_id', 'email',
|
||||
'enabled', 'id', 'name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.domain_id,
|
||||
@ -363,7 +363,7 @@ class TestUserCreate(TestUser):
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
def test_user_create_enable(self):
|
||||
arglist = [
|
||||
@ -398,7 +398,7 @@ class TestUserCreate(TestUser):
|
||||
|
||||
collist = ('default_project_id', 'domain_id', 'email',
|
||||
'enabled', 'id', 'name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.domain_id,
|
||||
@ -407,7 +407,7 @@ class TestUserCreate(TestUser):
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
def test_user_create_disable(self):
|
||||
arglist = [
|
||||
@ -441,7 +441,7 @@ class TestUserCreate(TestUser):
|
||||
|
||||
collist = ('default_project_id', 'domain_id', 'email',
|
||||
'enabled', 'id', 'name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.domain_id,
|
||||
@ -450,7 +450,7 @@ class TestUserCreate(TestUser):
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
|
||||
class TestUserDelete(TestUser):
|
||||
@ -553,7 +553,7 @@ class TestUserList(TestUser):
|
||||
)
|
||||
|
||||
collist = ['ID', 'Name']
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
@ -583,7 +583,7 @@ class TestUserList(TestUser):
|
||||
)
|
||||
|
||||
collist = ['ID', 'Name']
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
@ -613,7 +613,7 @@ class TestUserList(TestUser):
|
||||
)
|
||||
|
||||
collist = ['ID', 'Name']
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
@ -651,7 +651,7 @@ class TestUserList(TestUser):
|
||||
'Email',
|
||||
'Enabled',
|
||||
]
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
@ -683,7 +683,7 @@ class TestUserList(TestUser):
|
||||
self.users_mock.get.assert_called_with(identity_fakes.user_id)
|
||||
|
||||
collist = ['ID', 'Name']
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
@ -739,7 +739,7 @@ class TestUserSet(TestUser):
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
result = self.cmd.run(parsed_args)
|
||||
self.assertEqual(result, 0)
|
||||
self.assertEqual(0, result)
|
||||
|
||||
def test_user_set_name(self):
|
||||
arglist = [
|
||||
@ -1077,7 +1077,7 @@ class TestUserShow(TestUser):
|
||||
|
||||
collist = ('default_project_id', 'domain_id', 'email',
|
||||
'enabled', 'id', 'name')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.domain_id,
|
||||
@ -1086,4 +1086,4 @@ class TestUserShow(TestUser):
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
@ -331,7 +331,7 @@ class TestImageList(TestImage):
|
||||
|
||||
collist = ('ID', 'Name')
|
||||
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
image_fakes.image_id,
|
||||
image_fakes.image_name,
|
||||
@ -358,7 +358,7 @@ class TestImageList(TestImage):
|
||||
|
||||
collist = ('ID', 'Name')
|
||||
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
image_fakes.image_id,
|
||||
image_fakes.image_name,
|
||||
@ -385,7 +385,7 @@ class TestImageList(TestImage):
|
||||
|
||||
collist = ('ID', 'Name')
|
||||
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
image_fakes.image_id,
|
||||
image_fakes.image_name,
|
||||
@ -410,7 +410,7 @@ class TestImageList(TestImage):
|
||||
collist = ('ID', 'Name', 'Disk Format', 'Container Format',
|
||||
'Size', 'Status')
|
||||
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
image_fakes.image_id,
|
||||
image_fakes.image_name,
|
||||
|
@ -95,7 +95,7 @@ class TestImageList(TestImage):
|
||||
|
||||
collist = ('ID', 'Name')
|
||||
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
image_fakes.image_id,
|
||||
image_fakes.image_name,
|
||||
@ -122,7 +122,7 @@ class TestImageList(TestImage):
|
||||
|
||||
collist = ('ID', 'Name')
|
||||
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
image_fakes.image_id,
|
||||
image_fakes.image_name,
|
||||
@ -149,7 +149,7 @@ class TestImageList(TestImage):
|
||||
|
||||
collist = ('ID', 'Name')
|
||||
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
image_fakes.image_id,
|
||||
image_fakes.image_name,
|
||||
@ -174,7 +174,7 @@ class TestImageList(TestImage):
|
||||
collist = ('ID', 'Name', 'Disk Format', 'Container Format',
|
||||
'Size', 'Status')
|
||||
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
image_fakes.image_id,
|
||||
image_fakes.image_name,
|
||||
|
@ -105,11 +105,11 @@ class TestObjectList(TestObjectAll):
|
||||
columns, data = self.cmd.take_action(parsed_args)
|
||||
|
||||
collist = ('Name',)
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
(object_fakes.object_name_2, ),
|
||||
)
|
||||
self.assertEqual(tuple(data), datalist)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
|
||||
class TestObjectShow(TestObjectAll):
|
||||
|
@ -82,34 +82,34 @@ class TestShell(utils.TestCase):
|
||||
fake_execute(_shell, _cmd)
|
||||
|
||||
self.app.assert_called_with(["list", "project"])
|
||||
self.assertEqual(_shell.options.os_auth_url,
|
||||
default_args["auth_url"])
|
||||
self.assertEqual(_shell.options.os_project_id,
|
||||
default_args["project_id"])
|
||||
self.assertEqual(_shell.options.os_project_name,
|
||||
default_args["project_name"])
|
||||
self.assertEqual(_shell.options.os_domain_id,
|
||||
default_args["domain_id"])
|
||||
self.assertEqual(_shell.options.os_domain_name,
|
||||
default_args["domain_name"])
|
||||
self.assertEqual(_shell.options.os_user_domain_id,
|
||||
default_args["user_domain_id"])
|
||||
self.assertEqual(_shell.options.os_user_domain_name,
|
||||
default_args["user_domain_name"])
|
||||
self.assertEqual(_shell.options.os_project_domain_id,
|
||||
default_args["project_domain_id"])
|
||||
self.assertEqual(_shell.options.os_project_domain_name,
|
||||
default_args["project_domain_name"])
|
||||
self.assertEqual(_shell.options.os_username,
|
||||
default_args["username"])
|
||||
self.assertEqual(_shell.options.os_password,
|
||||
default_args["password"])
|
||||
self.assertEqual(_shell.options.os_region_name,
|
||||
default_args["region_name"])
|
||||
self.assertEqual(_shell.options.os_trust_id,
|
||||
default_args["trust_id"])
|
||||
self.assertEqual(_shell.options.os_auth_type,
|
||||
default_args['auth_type'])
|
||||
self.assertEqual(default_args["auth_url"],
|
||||
_shell.options.os_auth_url)
|
||||
self.assertEqual(default_args["project_id"],
|
||||
_shell.options.os_project_id)
|
||||
self.assertEqual(default_args["project_name"],
|
||||
_shell.options.os_project_name)
|
||||
self.assertEqual(default_args["domain_id"],
|
||||
_shell.options.os_domain_id)
|
||||
self.assertEqual(default_args["domain_name"],
|
||||
_shell.options.os_domain_name)
|
||||
self.assertEqual(default_args["user_domain_id"],
|
||||
_shell.options.os_user_domain_id)
|
||||
self.assertEqual(default_args["user_domain_name"],
|
||||
_shell.options.os_user_domain_name)
|
||||
self.assertEqual(default_args["project_domain_id"],
|
||||
_shell.options.os_project_domain_id)
|
||||
self.assertEqual(default_args["project_domain_name"],
|
||||
_shell.options.os_project_domain_name)
|
||||
self.assertEqual(default_args["username"],
|
||||
_shell.options.os_username)
|
||||
self.assertEqual(default_args["password"],
|
||||
_shell.options.os_password)
|
||||
self.assertEqual(default_args["region_name"],
|
||||
_shell.options.os_region_name)
|
||||
self.assertEqual(default_args["trust_id"],
|
||||
_shell.options.os_trust_id)
|
||||
self.assertEqual(default_args['auth_type'],
|
||||
_shell.options.os_auth_type)
|
||||
|
||||
def _assert_token_auth(self, cmd_options, default_args):
|
||||
with mock.patch("openstackclient.shell.OpenStackShell.initialize_app",
|
||||
@ -118,9 +118,9 @@ class TestShell(utils.TestCase):
|
||||
fake_execute(_shell, _cmd)
|
||||
|
||||
self.app.assert_called_with(["list", "role"])
|
||||
self.assertEqual(_shell.options.os_token, default_args["os_token"])
|
||||
self.assertEqual(_shell.options.os_auth_url,
|
||||
default_args["os_auth_url"])
|
||||
self.assertEqual(default_args["os_token"], _shell.options.os_token)
|
||||
self.assertEqual(default_args["os_auth_url"],
|
||||
_shell.options.os_auth_url)
|
||||
|
||||
def _assert_cli(self, cmd_options, default_args):
|
||||
with mock.patch("openstackclient.shell.OpenStackShell.initialize_app",
|
||||
@ -129,16 +129,16 @@ class TestShell(utils.TestCase):
|
||||
fake_execute(_shell, _cmd)
|
||||
|
||||
self.app.assert_called_with(["list", "server"])
|
||||
self.assertEqual(_shell.options.os_compute_api_version,
|
||||
default_args["compute_api_version"])
|
||||
self.assertEqual(_shell.options.os_identity_api_version,
|
||||
default_args["identity_api_version"])
|
||||
self.assertEqual(_shell.options.os_image_api_version,
|
||||
default_args["image_api_version"])
|
||||
self.assertEqual(_shell.options.os_volume_api_version,
|
||||
default_args["volume_api_version"])
|
||||
self.assertEqual(_shell.options.os_network_api_version,
|
||||
default_args["network_api_version"])
|
||||
self.assertEqual(default_args["compute_api_version"],
|
||||
_shell.options.os_compute_api_version)
|
||||
self.assertEqual(default_args["identity_api_version"],
|
||||
_shell.options.os_identity_api_version)
|
||||
self.assertEqual(default_args["image_api_version"],
|
||||
_shell.options.os_image_api_version)
|
||||
self.assertEqual(default_args["volume_api_version"],
|
||||
_shell.options.os_volume_api_version)
|
||||
self.assertEqual(default_args["network_api_version"],
|
||||
_shell.options.os_network_api_version)
|
||||
|
||||
|
||||
class TestShellHelp(TestShell):
|
||||
@ -161,8 +161,8 @@ class TestShellHelp(TestShell):
|
||||
_shell, _cmd = make_shell(), flag
|
||||
fake_execute(_shell, _cmd)
|
||||
|
||||
self.assertEqual(_shell.options.deferred_help,
|
||||
kwargs["deferred_help"])
|
||||
self.assertEqual(kwargs["deferred_help"],
|
||||
_shell.options.deferred_help)
|
||||
|
||||
|
||||
class TestShellPasswordAuth(TestShell):
|
||||
|
@ -93,5 +93,5 @@ class TestCommand(TestCase):
|
||||
attr, value = av
|
||||
if attr:
|
||||
self.assertIn(attr, parsed_args)
|
||||
self.assertEqual(getattr(parsed_args, attr), value)
|
||||
self.assertEqual(value, getattr(parsed_args, attr))
|
||||
return parsed_args
|
||||
|
Loading…
Reference in New Issue
Block a user