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