Changed the abstract columns and datalists from test cases of common and Identity
columns and datalist has been set in each test case in compute, which is not necessary. This patch abstract it out and remove all redundant code. Change-Id: I45a3582088161f12e60e7c933da8e7dcc0ae8e7b Closes-Bug: #1532384
This commit is contained in:
parent
a080227b07
commit
030aee6fbc
@ -18,6 +18,21 @@ from openstackclient.tests import utils
|
||||
|
||||
class TestConfiguration(utils.TestCommand):
|
||||
|
||||
columns = (
|
||||
'auth.password',
|
||||
'auth.token',
|
||||
'auth.username',
|
||||
'identity_api_version',
|
||||
'region',
|
||||
)
|
||||
datalist = (
|
||||
configuration.REDACTED,
|
||||
configuration.REDACTED,
|
||||
fakes.USERNAME,
|
||||
fakes.VERSION,
|
||||
fakes.REGION_NAME,
|
||||
)
|
||||
|
||||
def test_show(self):
|
||||
arglist = []
|
||||
verifylist = [('mask', True)]
|
||||
@ -26,17 +41,8 @@ class TestConfiguration(utils.TestCommand):
|
||||
|
||||
columns, data = cmd.take_action(parsed_args)
|
||||
|
||||
collist = ('auth.password', 'auth.token', 'auth.username',
|
||||
'identity_api_version', 'region')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
configuration.REDACTED,
|
||||
configuration.REDACTED,
|
||||
fakes.USERNAME,
|
||||
fakes.VERSION,
|
||||
fakes.REGION_NAME,
|
||||
)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_show_unmask(self):
|
||||
arglist = ['--unmask']
|
||||
@ -46,9 +52,7 @@ class TestConfiguration(utils.TestCommand):
|
||||
|
||||
columns, data = cmd.take_action(parsed_args)
|
||||
|
||||
collist = ('auth.password', 'auth.token', 'auth.username',
|
||||
'identity_api_version', 'region')
|
||||
self.assertEqual(collist, columns)
|
||||
self.assertEqual(self.columns, columns)
|
||||
datalist = (
|
||||
fakes.PASSWORD,
|
||||
fakes.AUTH_TOKEN,
|
||||
@ -56,7 +60,7 @@ class TestConfiguration(utils.TestCommand):
|
||||
fakes.VERSION,
|
||||
fakes.REGION_NAME,
|
||||
)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
def test_show_mask(self):
|
||||
arglist = ['--mask']
|
||||
@ -66,14 +70,5 @@ class TestConfiguration(utils.TestCommand):
|
||||
|
||||
columns, data = cmd.take_action(parsed_args)
|
||||
|
||||
collist = ('auth.password', 'auth.token', 'auth.username',
|
||||
'identity_api_version', 'region')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
configuration.REDACTED,
|
||||
configuration.REDACTED,
|
||||
fakes.USERNAME,
|
||||
fakes.VERSION,
|
||||
fakes.REGION_NAME,
|
||||
)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
@ -42,6 +42,8 @@ class TestExtension(utils.TestCommand):
|
||||
|
||||
class TestExtensionList(TestExtension):
|
||||
|
||||
columns = ('Name', 'Alias', 'Description')
|
||||
|
||||
def setUp(self):
|
||||
super(TestExtensionList, self).setUp()
|
||||
|
||||
@ -67,8 +69,7 @@ class TestExtensionList(TestExtension):
|
||||
# no args should output from all services
|
||||
self.identity_extensions_mock.list.assert_called_with()
|
||||
|
||||
collist = ('Name', 'Alias', 'Description')
|
||||
self.assertEqual(collist, columns)
|
||||
self.assertEqual(self.columns, columns)
|
||||
datalist = (
|
||||
(
|
||||
identity_fakes.extension_name,
|
||||
@ -135,8 +136,7 @@ class TestExtensionList(TestExtension):
|
||||
|
||||
self.identity_extensions_mock.list.assert_called_with()
|
||||
|
||||
collist = ('Name', 'Alias', 'Description')
|
||||
self.assertEqual(collist, columns)
|
||||
self.assertEqual(self.columns, columns)
|
||||
datalist = ((
|
||||
identity_fakes.extension_name,
|
||||
identity_fakes.extension_alias,
|
||||
@ -157,8 +157,7 @@ class TestExtensionList(TestExtension):
|
||||
|
||||
self.network_extensions_mock.assert_called_with()
|
||||
|
||||
collist = ('Name', 'Alias', 'Description')
|
||||
self.assertEqual(collist, columns)
|
||||
self.assertEqual(self.columns, columns)
|
||||
datalist = (
|
||||
(
|
||||
network_fakes.extension_name,
|
||||
|
@ -33,6 +33,11 @@ class FakeGenericClient(object):
|
||||
|
||||
class TestTiming(utils.TestCommand):
|
||||
|
||||
columns = (
|
||||
'URL',
|
||||
'Seconds',
|
||||
)
|
||||
|
||||
def setUp(self):
|
||||
super(TestTiming, self).setUp()
|
||||
|
||||
@ -59,8 +64,7 @@ class TestTiming(utils.TestCommand):
|
||||
# DisplayCommandBase.take_action() returns two tuples
|
||||
columns, data = self.cmd.take_action(parsed_args)
|
||||
|
||||
collist = ('URL', 'Seconds')
|
||||
self.assertEqual(collist, columns)
|
||||
self.assertEqual(self.columns, columns)
|
||||
datalist = [
|
||||
('Total', 0.0,)
|
||||
]
|
||||
@ -78,9 +82,7 @@ class TestTiming(utils.TestCommand):
|
||||
|
||||
# DisplayCommandBase.take_action() returns two tuples
|
||||
columns, data = self.cmd.take_action(parsed_args)
|
||||
|
||||
collist = ('URL', 'Seconds')
|
||||
self.assertEqual(collist, columns)
|
||||
self.assertEqual(self.columns, columns)
|
||||
datalist = [
|
||||
(timing_url, timing_elapsed),
|
||||
('Total', timing_elapsed),
|
||||
|
@ -55,6 +55,12 @@ class TestCatalog(utils.TestCommand):
|
||||
|
||||
class TestCatalogList(TestCatalog):
|
||||
|
||||
columns = (
|
||||
'Name',
|
||||
'Type',
|
||||
'Endpoints',
|
||||
)
|
||||
|
||||
def setUp(self):
|
||||
super(TestCatalogList, self).setUp()
|
||||
|
||||
@ -70,8 +76,7 @@ class TestCatalogList(TestCatalog):
|
||||
columns, data = self.cmd.take_action(parsed_args)
|
||||
self.sc_mock.service_catalog.get_data.assert_called_with()
|
||||
|
||||
collist = ('Name', 'Type', 'Endpoints')
|
||||
self.assertEqual(collist, columns)
|
||||
self.assertEqual(self.columns, columns)
|
||||
datalist = ((
|
||||
'supernova',
|
||||
'compute',
|
||||
@ -113,8 +118,7 @@ class TestCatalogList(TestCatalog):
|
||||
columns, data = self.cmd.take_action(parsed_args)
|
||||
self.sc_mock.service_catalog.get_data.assert_called_with()
|
||||
|
||||
collist = ('Name', 'Type', 'Endpoints')
|
||||
self.assertEqual(collist, columns)
|
||||
self.assertEqual(self.columns, columns)
|
||||
datalist = ((
|
||||
'supernova',
|
||||
'compute',
|
||||
|
@ -34,6 +34,19 @@ class TestProject(identity_fakes.TestIdentityv2):
|
||||
|
||||
class TestProjectCreate(TestProject):
|
||||
|
||||
columns = (
|
||||
'description',
|
||||
'enabled',
|
||||
'id',
|
||||
'name',
|
||||
)
|
||||
datalist = (
|
||||
identity_fakes.project_description,
|
||||
True,
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
)
|
||||
|
||||
def setUp(self):
|
||||
super(TestProjectCreate, self).setUp()
|
||||
|
||||
@ -69,16 +82,8 @@ class TestProjectCreate(TestProject):
|
||||
identity_fakes.project_name,
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id', 'name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_description,
|
||||
True,
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_project_create_description(self):
|
||||
arglist = [
|
||||
@ -104,15 +109,8 @@ class TestProjectCreate(TestProject):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id', 'name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_description,
|
||||
True,
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_project_create_enable(self):
|
||||
arglist = [
|
||||
@ -139,15 +137,8 @@ class TestProjectCreate(TestProject):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id', 'name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_description,
|
||||
True,
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_project_create_disable(self):
|
||||
arglist = [
|
||||
@ -174,15 +165,8 @@ class TestProjectCreate(TestProject):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id', 'name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_description,
|
||||
True,
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_project_create_property(self):
|
||||
arglist = [
|
||||
@ -211,15 +195,8 @@ class TestProjectCreate(TestProject):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id', 'name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_description,
|
||||
True,
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_project_create_or_show_exists(self):
|
||||
def _raise_conflict(*args, **kwargs):
|
||||
@ -260,15 +237,8 @@ class TestProjectCreate(TestProject):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id', 'name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_description,
|
||||
True,
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_project_create_or_show_not_exists(self):
|
||||
arglist = [
|
||||
@ -294,15 +264,8 @@ class TestProjectCreate(TestProject):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id', 'name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_description,
|
||||
True,
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
|
||||
class TestProjectDelete(TestProject):
|
||||
|
@ -107,6 +107,15 @@ class TestRoleAdd(TestRole):
|
||||
|
||||
class TestRoleCreate(TestRole):
|
||||
|
||||
columns = (
|
||||
'id',
|
||||
'name'
|
||||
)
|
||||
datalist = (
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.role_name,
|
||||
)
|
||||
|
||||
def setUp(self):
|
||||
super(TestRoleCreate, self).setUp()
|
||||
|
||||
@ -136,13 +145,8 @@ class TestRoleCreate(TestRole):
|
||||
identity_fakes.role_name,
|
||||
)
|
||||
|
||||
collist = ('id', 'name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.role_name,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_role_create_or_show_exists(self):
|
||||
def _raise_conflict(*args, **kwargs):
|
||||
@ -178,13 +182,8 @@ class TestRoleCreate(TestRole):
|
||||
identity_fakes.role_name,
|
||||
)
|
||||
|
||||
collist = ('id', 'name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.role_name,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_role_create_or_show_not_exists(self):
|
||||
arglist = [
|
||||
@ -205,13 +204,8 @@ class TestRoleCreate(TestRole):
|
||||
identity_fakes.role_name,
|
||||
)
|
||||
|
||||
collist = ('id', 'name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.role_name,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
|
||||
class TestRoleDelete(TestRole):
|
||||
@ -283,6 +277,13 @@ class TestRoleList(TestRole):
|
||||
|
||||
class TestUserRoleList(TestRole):
|
||||
|
||||
columns = (
|
||||
'ID',
|
||||
'Name',
|
||||
'Project',
|
||||
'User'
|
||||
)
|
||||
|
||||
def setUp(self):
|
||||
super(TestUserRoleList, self).setUp()
|
||||
|
||||
@ -395,8 +396,7 @@ class TestUserRoleList(TestRole):
|
||||
identity_fakes.PROJECT_2['id'],
|
||||
)
|
||||
|
||||
collist = ('ID', 'Name', 'Project', 'User')
|
||||
self.assertEqual(collist, columns)
|
||||
self.assertEqual(columns, columns)
|
||||
datalist = ((
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.role_name,
|
||||
|
@ -32,6 +32,19 @@ class TestService(identity_fakes.TestIdentityv2):
|
||||
|
||||
class TestServiceCreate(TestService):
|
||||
|
||||
columns = (
|
||||
'description',
|
||||
'id',
|
||||
'name',
|
||||
'type',
|
||||
)
|
||||
datalist = (
|
||||
identity_fakes.service_description,
|
||||
identity_fakes.service_id,
|
||||
identity_fakes.service_name,
|
||||
identity_fakes.service_type,
|
||||
)
|
||||
|
||||
def setUp(self):
|
||||
super(TestServiceCreate, self).setUp()
|
||||
|
||||
@ -66,15 +79,8 @@ class TestServiceCreate(TestService):
|
||||
None,
|
||||
)
|
||||
|
||||
collist = ('description', 'id', 'name', 'type')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.service_description,
|
||||
identity_fakes.service_id,
|
||||
identity_fakes.service_name,
|
||||
identity_fakes.service_type,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_service_create_with_type_option(self):
|
||||
arglist = [
|
||||
@ -99,15 +105,8 @@ class TestServiceCreate(TestService):
|
||||
None,
|
||||
)
|
||||
|
||||
collist = ('description', 'id', 'name', 'type')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.service_description,
|
||||
identity_fakes.service_id,
|
||||
identity_fakes.service_name,
|
||||
identity_fakes.service_type,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_service_create_with_name_option(self):
|
||||
arglist = [
|
||||
@ -132,15 +131,8 @@ class TestServiceCreate(TestService):
|
||||
None,
|
||||
)
|
||||
|
||||
collist = ('description', 'id', 'name', 'type')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.service_description,
|
||||
identity_fakes.service_id,
|
||||
identity_fakes.service_name,
|
||||
identity_fakes.service_type,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_service_create_description(self):
|
||||
arglist = [
|
||||
@ -166,15 +158,8 @@ class TestServiceCreate(TestService):
|
||||
identity_fakes.service_description,
|
||||
)
|
||||
|
||||
collist = ('description', 'id', 'name', 'type')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.service_description,
|
||||
identity_fakes.service_id,
|
||||
identity_fakes.service_name,
|
||||
identity_fakes.service_type,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
|
||||
class TestServiceDelete(TestService):
|
||||
|
@ -39,6 +39,21 @@ class TestUser(identity_fakes.TestIdentityv2):
|
||||
|
||||
class TestUserCreate(TestUser):
|
||||
|
||||
columns = (
|
||||
'email',
|
||||
'enabled',
|
||||
'id',
|
||||
'name',
|
||||
'project_id',
|
||||
)
|
||||
datalist = (
|
||||
identity_fakes.user_email,
|
||||
True,
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
identity_fakes.project_id,
|
||||
)
|
||||
|
||||
def setUp(self):
|
||||
super(TestUserCreate, self).setUp()
|
||||
|
||||
@ -84,16 +99,8 @@ class TestUserCreate(TestUser):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('email', 'enabled', 'id', 'name', 'project_id')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.user_email,
|
||||
True,
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
identity_fakes.project_id,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_user_create_password(self):
|
||||
arglist = [
|
||||
@ -122,17 +129,8 @@ class TestUserCreate(TestUser):
|
||||
None,
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('email', 'enabled', 'id', 'name', 'project_id')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.user_email,
|
||||
True,
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
identity_fakes.project_id,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_user_create_password_prompt(self):
|
||||
arglist = [
|
||||
@ -164,16 +162,8 @@ class TestUserCreate(TestUser):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('email', 'enabled', 'id', 'name', 'project_id')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.user_email,
|
||||
True,
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
identity_fakes.project_id,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_user_create_email(self):
|
||||
arglist = [
|
||||
@ -202,16 +192,8 @@ class TestUserCreate(TestUser):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('email', 'enabled', 'id', 'name', 'project_id')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.user_email,
|
||||
True,
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
identity_fakes.project_id,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_user_create_project(self):
|
||||
# Return the new project
|
||||
@ -255,8 +237,7 @@ class TestUserCreate(TestUser):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('email', 'enabled', 'id', 'name', 'project_id')
|
||||
self.assertEqual(collist, columns)
|
||||
self.assertEqual(self.columns, columns)
|
||||
datalist = (
|
||||
identity_fakes.user_email,
|
||||
True,
|
||||
@ -294,16 +275,8 @@ class TestUserCreate(TestUser):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('email', 'enabled', 'id', 'name', 'project_id')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.user_email,
|
||||
True,
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
identity_fakes.project_id,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_user_create_disable(self):
|
||||
arglist = [
|
||||
@ -333,16 +306,8 @@ class TestUserCreate(TestUser):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('email', 'enabled', 'id', 'name', 'project_id')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.user_email,
|
||||
True,
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
identity_fakes.project_id,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_user_create_or_show_exists(self):
|
||||
def _raise_conflict(*args, **kwargs):
|
||||
@ -373,16 +338,8 @@ class TestUserCreate(TestUser):
|
||||
# UserManager.create(name, password, email, tenant_id=, enabled=)
|
||||
self.users_mock.get.assert_called_with(identity_fakes.user_name)
|
||||
|
||||
collist = ('email', 'enabled', 'id', 'name', 'project_id')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.user_email,
|
||||
True,
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
identity_fakes.project_id,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_user_create_or_show_not_exists(self):
|
||||
arglist = [
|
||||
@ -410,17 +367,8 @@ class TestUserCreate(TestUser):
|
||||
None,
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('email', 'enabled', 'id', 'name', 'project_id')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.user_email,
|
||||
True,
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
identity_fakes.project_id,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
|
||||
class TestUserDelete(TestUser):
|
||||
@ -458,6 +406,17 @@ class TestUserDelete(TestUser):
|
||||
|
||||
class TestUserList(TestUser):
|
||||
|
||||
columns = (
|
||||
'ID',
|
||||
'Name',
|
||||
)
|
||||
datalist = (
|
||||
(
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
),
|
||||
)
|
||||
|
||||
def setUp(self):
|
||||
super(TestUserList, self).setUp()
|
||||
|
||||
@ -495,13 +454,8 @@ class TestUserList(TestUser):
|
||||
|
||||
self.users_mock.list.assert_called_with(tenant_id=None)
|
||||
|
||||
collist = ('ID', 'Name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
), )
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, tuple(data))
|
||||
|
||||
def test_user_list_project(self):
|
||||
arglist = [
|
||||
@ -518,13 +472,8 @@ class TestUserList(TestUser):
|
||||
|
||||
self.users_mock.list.assert_called_with(tenant_id=project_id)
|
||||
|
||||
collist = ('ID', 'Name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
), )
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, tuple(data))
|
||||
|
||||
def test_user_list_long(self):
|
||||
arglist = [
|
||||
|
@ -29,6 +29,19 @@ class TestDomain(identity_fakes.TestIdentityv3):
|
||||
|
||||
class TestDomainCreate(TestDomain):
|
||||
|
||||
columns = (
|
||||
'description',
|
||||
'enabled',
|
||||
'id',
|
||||
'name',
|
||||
)
|
||||
datalist = (
|
||||
identity_fakes.domain_description,
|
||||
True,
|
||||
identity_fakes.domain_id,
|
||||
identity_fakes.domain_name,
|
||||
)
|
||||
|
||||
def setUp(self):
|
||||
super(TestDomainCreate, self).setUp()
|
||||
|
||||
@ -63,15 +76,8 @@ class TestDomainCreate(TestDomain):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id', 'name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.domain_description,
|
||||
True,
|
||||
identity_fakes.domain_id,
|
||||
identity_fakes.domain_name,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_domain_create_description(self):
|
||||
arglist = [
|
||||
@ -97,15 +103,8 @@ class TestDomainCreate(TestDomain):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id', 'name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.domain_description,
|
||||
True,
|
||||
identity_fakes.domain_id,
|
||||
identity_fakes.domain_name,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_domain_create_enable(self):
|
||||
arglist = [
|
||||
@ -131,15 +130,8 @@ class TestDomainCreate(TestDomain):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id', 'name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.domain_description,
|
||||
True,
|
||||
identity_fakes.domain_id,
|
||||
identity_fakes.domain_name,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_domain_create_disable(self):
|
||||
arglist = [
|
||||
@ -165,15 +157,8 @@ class TestDomainCreate(TestDomain):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id', 'name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.domain_description,
|
||||
True,
|
||||
identity_fakes.domain_id,
|
||||
identity_fakes.domain_name,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
|
||||
class TestDomainDelete(TestDomain):
|
||||
|
@ -37,6 +37,17 @@ class TestEndpoint(identity_fakes.TestIdentityv3):
|
||||
|
||||
class TestEndpointCreate(TestEndpoint):
|
||||
|
||||
columns = (
|
||||
'enabled',
|
||||
'id',
|
||||
'interface',
|
||||
'region',
|
||||
'service_id',
|
||||
'service_name',
|
||||
'service_type',
|
||||
'url',
|
||||
)
|
||||
|
||||
def setUp(self):
|
||||
super(TestEndpointCreate, self).setUp()
|
||||
|
||||
@ -86,9 +97,7 @@ class TestEndpointCreate(TestEndpoint):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('enabled', 'id', 'interface', 'region', 'service_id',
|
||||
'service_name', 'service_type', 'url')
|
||||
self.assertEqual(collist, columns)
|
||||
self.assertEqual(self.columns, columns)
|
||||
datalist = (
|
||||
True,
|
||||
identity_fakes.endpoint_id,
|
||||
@ -133,9 +142,7 @@ class TestEndpointCreate(TestEndpoint):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('enabled', 'id', 'interface', 'region', 'service_id',
|
||||
'service_name', 'service_type', 'url')
|
||||
self.assertEqual(collist, columns)
|
||||
self.assertEqual(self.columns, columns)
|
||||
datalist = (
|
||||
True,
|
||||
identity_fakes.endpoint_id,
|
||||
@ -179,9 +186,7 @@ class TestEndpointCreate(TestEndpoint):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('enabled', 'id', 'interface', 'region', 'service_id',
|
||||
'service_name', 'service_type', 'url')
|
||||
self.assertEqual(collist, columns)
|
||||
self.assertEqual(self.columns, columns)
|
||||
datalist = (
|
||||
True,
|
||||
identity_fakes.endpoint_id,
|
||||
@ -225,9 +230,7 @@ class TestEndpointCreate(TestEndpoint):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('enabled', 'id', 'interface', 'region', 'service_id',
|
||||
'service_name', 'service_type', 'url')
|
||||
self.assertEqual(collist, columns)
|
||||
self.assertEqual(self.columns, columns)
|
||||
datalist = (
|
||||
True,
|
||||
identity_fakes.endpoint_id,
|
||||
@ -276,6 +279,16 @@ class TestEndpointDelete(TestEndpoint):
|
||||
|
||||
class TestEndpointList(TestEndpoint):
|
||||
|
||||
columns = (
|
||||
'ID',
|
||||
'Region',
|
||||
'Service Name',
|
||||
'Service Type',
|
||||
'Enabled',
|
||||
'Interface',
|
||||
'URL',
|
||||
)
|
||||
|
||||
def setUp(self):
|
||||
super(TestEndpointList, self).setUp()
|
||||
|
||||
@ -306,18 +319,18 @@ class TestEndpointList(TestEndpoint):
|
||||
columns, data = self.cmd.take_action(parsed_args)
|
||||
self.endpoints_mock.list.assert_called_with()
|
||||
|
||||
collist = ('ID', 'Region', 'Service Name', 'Service Type',
|
||||
'Enabled', 'Interface', 'URL')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.endpoint_id,
|
||||
identity_fakes.endpoint_region,
|
||||
self.get_fake_service_name(),
|
||||
identity_fakes.service_type,
|
||||
True,
|
||||
identity_fakes.endpoint_interface,
|
||||
identity_fakes.endpoint_url,
|
||||
),)
|
||||
self.assertEqual(self.columns, columns)
|
||||
datalist = (
|
||||
(
|
||||
identity_fakes.endpoint_id,
|
||||
identity_fakes.endpoint_region,
|
||||
self.get_fake_service_name(),
|
||||
identity_fakes.service_type,
|
||||
True,
|
||||
identity_fakes.endpoint_interface,
|
||||
identity_fakes.endpoint_url,
|
||||
),
|
||||
)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
def test_endpoint_list_service(self):
|
||||
@ -338,18 +351,18 @@ class TestEndpointList(TestEndpoint):
|
||||
}
|
||||
self.endpoints_mock.list.assert_called_with(**kwargs)
|
||||
|
||||
collist = ('ID', 'Region', 'Service Name', 'Service Type',
|
||||
'Enabled', 'Interface', 'URL')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.endpoint_id,
|
||||
identity_fakes.endpoint_region,
|
||||
self.get_fake_service_name(),
|
||||
identity_fakes.service_type,
|
||||
True,
|
||||
identity_fakes.endpoint_interface,
|
||||
identity_fakes.endpoint_url,
|
||||
),)
|
||||
self.assertEqual(self.columns, columns)
|
||||
datalist = (
|
||||
(
|
||||
identity_fakes.endpoint_id,
|
||||
identity_fakes.endpoint_region,
|
||||
self.get_fake_service_name(),
|
||||
identity_fakes.service_type,
|
||||
True,
|
||||
identity_fakes.endpoint_interface,
|
||||
identity_fakes.endpoint_url,
|
||||
),
|
||||
)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
def test_endpoint_list_interface(self):
|
||||
@ -370,18 +383,18 @@ class TestEndpointList(TestEndpoint):
|
||||
}
|
||||
self.endpoints_mock.list.assert_called_with(**kwargs)
|
||||
|
||||
collist = ('ID', 'Region', 'Service Name', 'Service Type',
|
||||
'Enabled', 'Interface', 'URL')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.endpoint_id,
|
||||
identity_fakes.endpoint_region,
|
||||
self.get_fake_service_name(),
|
||||
identity_fakes.service_type,
|
||||
True,
|
||||
identity_fakes.endpoint_interface,
|
||||
identity_fakes.endpoint_url,
|
||||
),)
|
||||
self.assertEqual(self.columns, columns)
|
||||
datalist = (
|
||||
(
|
||||
identity_fakes.endpoint_id,
|
||||
identity_fakes.endpoint_region,
|
||||
self.get_fake_service_name(),
|
||||
identity_fakes.service_type,
|
||||
True,
|
||||
identity_fakes.endpoint_interface,
|
||||
identity_fakes.endpoint_url,
|
||||
),
|
||||
)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
def test_endpoint_list_region(self):
|
||||
@ -402,18 +415,18 @@ class TestEndpointList(TestEndpoint):
|
||||
}
|
||||
self.endpoints_mock.list.assert_called_with(**kwargs)
|
||||
|
||||
collist = ('ID', 'Region', 'Service Name', 'Service Type',
|
||||
'Enabled', 'Interface', 'URL')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.endpoint_id,
|
||||
identity_fakes.endpoint_region,
|
||||
self.get_fake_service_name(),
|
||||
identity_fakes.service_type,
|
||||
True,
|
||||
identity_fakes.endpoint_interface,
|
||||
identity_fakes.endpoint_url,
|
||||
),)
|
||||
self.assertEqual(self.columns, columns)
|
||||
datalist = (
|
||||
(
|
||||
identity_fakes.endpoint_id,
|
||||
identity_fakes.endpoint_region,
|
||||
self.get_fake_service_name(),
|
||||
identity_fakes.service_type,
|
||||
True,
|
||||
identity_fakes.endpoint_interface,
|
||||
identity_fakes.endpoint_url,
|
||||
),
|
||||
)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
|
||||
@ -658,8 +671,16 @@ class TestEndpointShow(TestEndpoint):
|
||||
identity_fakes.endpoint_id,
|
||||
)
|
||||
|
||||
collist = ('enabled', 'id', 'interface', 'region', 'service_id',
|
||||
'service_name', 'service_type', 'url')
|
||||
collist = (
|
||||
'enabled',
|
||||
'id',
|
||||
'interface',
|
||||
'region',
|
||||
'service_id',
|
||||
'service_name',
|
||||
'service_type',
|
||||
'url',
|
||||
)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
True,
|
||||
|
@ -38,6 +38,17 @@ class TestGroup(identity_fakes.TestIdentityv3):
|
||||
|
||||
class TestGroupList(TestGroup):
|
||||
|
||||
columns = (
|
||||
'ID',
|
||||
'Name',
|
||||
)
|
||||
datalist = (
|
||||
(
|
||||
identity_fakes.group_id,
|
||||
identity_fakes.group_name,
|
||||
),
|
||||
)
|
||||
|
||||
def setUp(self):
|
||||
super(TestGroupList, self).setUp()
|
||||
|
||||
@ -87,13 +98,8 @@ class TestGroupList(TestGroup):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('ID', 'Name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.group_id,
|
||||
identity_fakes.group_name,
|
||||
), )
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, tuple(data))
|
||||
|
||||
def test_group_list_domain(self):
|
||||
arglist = [
|
||||
@ -117,13 +123,8 @@ class TestGroupList(TestGroup):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('ID', 'Name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.group_id,
|
||||
identity_fakes.group_name,
|
||||
), )
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, tuple(data))
|
||||
|
||||
def test_group_list_user(self):
|
||||
arglist = [
|
||||
@ -147,13 +148,8 @@ class TestGroupList(TestGroup):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('ID', 'Name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.group_id,
|
||||
identity_fakes.group_name,
|
||||
), )
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, tuple(data))
|
||||
|
||||
def test_group_list_long(self):
|
||||
arglist = [
|
||||
@ -177,17 +173,15 @@ class TestGroupList(TestGroup):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = (
|
||||
'ID',
|
||||
'Name',
|
||||
columns = self.columns + (
|
||||
'Domain ID',
|
||||
'Description',
|
||||
)
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.group_id,
|
||||
identity_fakes.group_name,
|
||||
'',
|
||||
'',
|
||||
), )
|
||||
self.assertEqual(columns, columns)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
@ -33,6 +33,19 @@ class TestIdentityProvider(identity_fakes.TestFederatedIdentity):
|
||||
|
||||
class TestIdentityProviderCreate(TestIdentityProvider):
|
||||
|
||||
columns = (
|
||||
'description',
|
||||
'enabled',
|
||||
'id',
|
||||
'remote_ids',
|
||||
)
|
||||
datalist = (
|
||||
identity_fakes.idp_description,
|
||||
True,
|
||||
identity_fakes.idp_id,
|
||||
identity_fakes.formatted_idp_remote_ids,
|
||||
)
|
||||
|
||||
def setUp(self):
|
||||
super(TestIdentityProviderCreate, self).setUp()
|
||||
|
||||
@ -63,15 +76,8 @@ class TestIdentityProviderCreate(TestIdentityProvider):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id', 'remote_ids')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.idp_description,
|
||||
True,
|
||||
identity_fakes.idp_id,
|
||||
identity_fakes.formatted_idp_remote_ids
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_create_identity_provider_description(self):
|
||||
arglist = [
|
||||
@ -97,15 +103,8 @@ class TestIdentityProviderCreate(TestIdentityProvider):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id', 'remote_ids')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.idp_description,
|
||||
True,
|
||||
identity_fakes.idp_id,
|
||||
identity_fakes.formatted_idp_remote_ids
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_create_identity_provider_remote_id(self):
|
||||
arglist = [
|
||||
@ -131,15 +130,8 @@ class TestIdentityProviderCreate(TestIdentityProvider):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id', 'remote_ids')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.idp_description,
|
||||
True,
|
||||
identity_fakes.idp_id,
|
||||
identity_fakes.formatted_idp_remote_ids
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_create_identity_provider_remote_ids_multiple(self):
|
||||
arglist = [
|
||||
@ -166,15 +158,8 @@ class TestIdentityProviderCreate(TestIdentityProvider):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id', 'remote_ids')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.idp_description,
|
||||
True,
|
||||
identity_fakes.idp_id,
|
||||
identity_fakes.formatted_idp_remote_ids
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_create_identity_provider_remote_ids_file(self):
|
||||
arglist = [
|
||||
@ -205,15 +190,8 @@ class TestIdentityProviderCreate(TestIdentityProvider):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id', 'remote_ids')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.idp_description,
|
||||
True,
|
||||
identity_fakes.idp_id,
|
||||
identity_fakes.formatted_idp_remote_ids
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_create_identity_provider_disabled(self):
|
||||
|
||||
@ -247,8 +225,7 @@ class TestIdentityProviderCreate(TestIdentityProvider):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id', 'remote_ids')
|
||||
self.assertEqual(collist, columns)
|
||||
self.assertEqual(self.columns, columns)
|
||||
datalist = (
|
||||
None,
|
||||
False,
|
||||
@ -370,6 +347,19 @@ class TestIdentityProviderShow(TestIdentityProvider):
|
||||
|
||||
class TestIdentityProviderSet(TestIdentityProvider):
|
||||
|
||||
columns = (
|
||||
'description',
|
||||
'enabled',
|
||||
'id',
|
||||
'remote_ids',
|
||||
)
|
||||
datalist = (
|
||||
identity_fakes.idp_description,
|
||||
True,
|
||||
identity_fakes.idp_id,
|
||||
identity_fakes.idp_remote_ids,
|
||||
)
|
||||
|
||||
def setUp(self):
|
||||
super(TestIdentityProviderSet, self).setUp()
|
||||
self.cmd = identity_provider.SetIdentityProvider(self.app, None)
|
||||
@ -401,15 +391,12 @@ class TestIdentityProviderSet(TestIdentityProvider):
|
||||
('remote_id', None)
|
||||
]
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
columns, data = self.cmd.take_action(parsed_args)
|
||||
self.identity_providers_mock.update.assert_called_with(
|
||||
identity_fakes.idp_id,
|
||||
description=new_description
|
||||
description=new_description,
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id', 'remote_ids')
|
||||
self.assertEqual(collist, columns)
|
||||
self.assertEqual(self.columns, columns)
|
||||
datalist = (
|
||||
identity_fakes.idp_description,
|
||||
False,
|
||||
@ -456,8 +443,7 @@ class TestIdentityProviderSet(TestIdentityProvider):
|
||||
remote_ids=identity_fakes.idp_remote_ids
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id', 'remote_ids')
|
||||
self.assertEqual(collist, columns)
|
||||
self.assertEqual(self.columns, columns)
|
||||
datalist = (
|
||||
identity_fakes.idp_description,
|
||||
False,
|
||||
@ -499,15 +485,8 @@ class TestIdentityProviderSet(TestIdentityProvider):
|
||||
self.identity_providers_mock.update.assert_called_with(
|
||||
identity_fakes.idp_id, enabled=True,
|
||||
remote_ids=identity_fakes.idp_remote_ids)
|
||||
collist = ('description', 'enabled', 'id', 'remote_ids')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.idp_description,
|
||||
True,
|
||||
identity_fakes.idp_id,
|
||||
identity_fakes.idp_remote_ids
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_identity_provider_replace_remote_ids(self):
|
||||
"""Enable Identity Provider.
|
||||
@ -545,8 +524,7 @@ class TestIdentityProviderSet(TestIdentityProvider):
|
||||
self.identity_providers_mock.update.assert_called_with(
|
||||
identity_fakes.idp_id, enabled=True,
|
||||
remote_ids=[self.new_remote_id])
|
||||
collist = ('description', 'enabled', 'id', 'remote_ids')
|
||||
self.assertEqual(collist, columns)
|
||||
self.assertEqual(self.columns, columns)
|
||||
datalist = (
|
||||
identity_fakes.idp_description,
|
||||
True,
|
||||
@ -595,8 +573,7 @@ class TestIdentityProviderSet(TestIdentityProvider):
|
||||
self.identity_providers_mock.update.assert_called_with(
|
||||
identity_fakes.idp_id, enabled=True,
|
||||
remote_ids=[self.new_remote_id])
|
||||
collist = ('description', 'enabled', 'id', 'remote_ids')
|
||||
self.assertEqual(collist, columns)
|
||||
self.assertEqual(self.columns, columns)
|
||||
datalist = (
|
||||
identity_fakes.idp_description,
|
||||
True,
|
||||
|
@ -38,6 +38,21 @@ class TestProject(identity_fakes.TestIdentityv3):
|
||||
|
||||
class TestProjectCreate(TestProject):
|
||||
|
||||
columns = (
|
||||
'description',
|
||||
'domain_id',
|
||||
'enabled',
|
||||
'id',
|
||||
'name'
|
||||
)
|
||||
datalist = (
|
||||
identity_fakes.project_description,
|
||||
identity_fakes.domain_id,
|
||||
True,
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
)
|
||||
|
||||
def setUp(self):
|
||||
super(TestProjectCreate, self).setUp()
|
||||
|
||||
@ -127,16 +142,8 @@ class TestProjectCreate(TestProject):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('description', 'domain_id', 'enabled', 'id', 'name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_description,
|
||||
identity_fakes.domain_id,
|
||||
True,
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_project_create_domain(self):
|
||||
arglist = [
|
||||
@ -169,16 +176,8 @@ class TestProjectCreate(TestProject):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('description', 'domain_id', 'enabled', 'id', 'name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_description,
|
||||
identity_fakes.domain_id,
|
||||
True,
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_project_create_domain_no_perms(self):
|
||||
arglist = [
|
||||
@ -210,16 +209,8 @@ class TestProjectCreate(TestProject):
|
||||
self.projects_mock.create.assert_called_with(
|
||||
**kwargs
|
||||
)
|
||||
collist = ('description', 'domain_id', 'enabled', 'id', 'name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_description,
|
||||
identity_fakes.domain_id,
|
||||
True,
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_project_create_enable(self):
|
||||
arglist = [
|
||||
@ -251,16 +242,8 @@ class TestProjectCreate(TestProject):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('description', 'domain_id', 'enabled', 'id', 'name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_description,
|
||||
identity_fakes.domain_id,
|
||||
True,
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_project_create_disable(self):
|
||||
arglist = [
|
||||
@ -292,16 +275,8 @@ class TestProjectCreate(TestProject):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('description', 'domain_id', 'enabled', 'id', 'name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_description,
|
||||
identity_fakes.domain_id,
|
||||
True,
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_project_create_property(self):
|
||||
arglist = [
|
||||
@ -334,16 +309,8 @@ class TestProjectCreate(TestProject):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('description', 'domain_id', 'enabled', 'id', 'name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_description,
|
||||
identity_fakes.domain_id,
|
||||
True,
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_project_create_parent(self):
|
||||
self.projects_mock.get.return_value = fakes.FakeResource(
|
||||
@ -467,6 +434,17 @@ class TestProjectDelete(TestProject):
|
||||
|
||||
class TestProjectList(TestProject):
|
||||
|
||||
columns = (
|
||||
'ID',
|
||||
'Name',
|
||||
)
|
||||
datalist = (
|
||||
(
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
),
|
||||
)
|
||||
|
||||
def setUp(self):
|
||||
super(TestProjectList, self).setUp()
|
||||
|
||||
@ -490,13 +468,8 @@ class TestProjectList(TestProject):
|
||||
columns, data = self.cmd.take_action(parsed_args)
|
||||
self.projects_mock.list.assert_called_with()
|
||||
|
||||
collist = ('ID', 'Name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
), )
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, tuple(data))
|
||||
|
||||
def test_project_list_long(self):
|
||||
arglist = [
|
||||
@ -543,13 +516,8 @@ class TestProjectList(TestProject):
|
||||
self.projects_mock.list.assert_called_with(
|
||||
domain=identity_fakes.domain_id)
|
||||
|
||||
collist = ('ID', 'Name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
), )
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, tuple(data))
|
||||
|
||||
def test_project_list_domain_no_perms(self):
|
||||
arglist = [
|
||||
@ -567,13 +535,8 @@ class TestProjectList(TestProject):
|
||||
|
||||
self.projects_mock.list.assert_called_with(
|
||||
domain=identity_fakes.domain_id)
|
||||
collist = ('ID', 'Name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.project_name,
|
||||
), )
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, tuple(data))
|
||||
|
||||
|
||||
class TestProjectSet(TestProject):
|
||||
|
@ -30,6 +30,17 @@ class TestRegion(identity_fakes.TestIdentityv3):
|
||||
|
||||
class TestRegionCreate(TestRegion):
|
||||
|
||||
columns = (
|
||||
'description',
|
||||
'parent_region',
|
||||
'region',
|
||||
)
|
||||
datalist = (
|
||||
identity_fakes.region_description,
|
||||
identity_fakes.region_parent_region_id,
|
||||
identity_fakes.region_id,
|
||||
)
|
||||
|
||||
def setUp(self):
|
||||
super(TestRegionCreate, self).setUp()
|
||||
|
||||
@ -66,14 +77,8 @@ class TestRegionCreate(TestRegion):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('description', 'parent_region', 'region')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.region_description,
|
||||
identity_fakes.region_parent_region_id,
|
||||
identity_fakes.region_id,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_region_create_no_options(self):
|
||||
arglist = [
|
||||
@ -97,14 +102,8 @@ class TestRegionCreate(TestRegion):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('description', 'parent_region', 'region')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.region_description,
|
||||
identity_fakes.region_parent_region_id,
|
||||
identity_fakes.region_id,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_region_create_parent_region_id(self):
|
||||
arglist = [
|
||||
@ -129,15 +128,8 @@ class TestRegionCreate(TestRegion):
|
||||
self.regions_mock.create.assert_called_with(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('description', 'parent_region', 'region')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.region_description,
|
||||
identity_fakes.region_parent_region_id,
|
||||
identity_fakes.region_id,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
|
||||
class TestRegionDelete(TestRegion):
|
||||
@ -169,6 +161,19 @@ class TestRegionDelete(TestRegion):
|
||||
|
||||
class TestRegionList(TestRegion):
|
||||
|
||||
columns = (
|
||||
'Region',
|
||||
'Parent Region',
|
||||
'Description',
|
||||
)
|
||||
datalist = (
|
||||
(
|
||||
identity_fakes.region_id,
|
||||
identity_fakes.region_parent_region_id,
|
||||
identity_fakes.region_description,
|
||||
),
|
||||
)
|
||||
|
||||
def setUp(self):
|
||||
super(TestRegionList, self).setUp()
|
||||
|
||||
@ -192,14 +197,8 @@ class TestRegionList(TestRegion):
|
||||
columns, data = self.cmd.take_action(parsed_args)
|
||||
self.regions_mock.list.assert_called_with()
|
||||
|
||||
collist = ('Region', 'Parent Region', 'Description')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.region_id,
|
||||
identity_fakes.region_parent_region_id,
|
||||
identity_fakes.region_description,
|
||||
), )
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, tuple(data))
|
||||
|
||||
def test_region_list_parent_region_id(self):
|
||||
arglist = [
|
||||
@ -215,14 +214,8 @@ class TestRegionList(TestRegion):
|
||||
self.regions_mock.list.assert_called_with(
|
||||
parent_region_id=identity_fakes.region_parent_region_id)
|
||||
|
||||
collist = ('Region', 'Parent Region', 'Description')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.region_id,
|
||||
identity_fakes.region_parent_region_id,
|
||||
identity_fakes.region_description,
|
||||
), )
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, tuple(data))
|
||||
|
||||
|
||||
class TestRegionSet(TestRegion):
|
||||
|
@ -314,6 +314,17 @@ class TestRoleDelete(TestRole):
|
||||
|
||||
class TestRoleList(TestRole):
|
||||
|
||||
columns = (
|
||||
'ID',
|
||||
'Name',
|
||||
)
|
||||
datalist = (
|
||||
(
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.role_name,
|
||||
),
|
||||
)
|
||||
|
||||
def setUp(self):
|
||||
super(TestRoleList, self).setUp()
|
||||
|
||||
@ -359,13 +370,8 @@ class TestRoleList(TestRole):
|
||||
|
||||
self.roles_mock.list.assert_called_with()
|
||||
|
||||
collist = ('ID', 'Name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.role_name,
|
||||
), )
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, tuple(data))
|
||||
|
||||
def test_user_list_inherited(self):
|
||||
arglist = [
|
||||
@ -392,13 +398,8 @@ class TestRoleList(TestRole):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('ID', 'Name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.role_name,
|
||||
), )
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, tuple(data))
|
||||
|
||||
def test_user_list_user(self):
|
||||
arglist = [
|
||||
@ -423,13 +424,8 @@ class TestRoleList(TestRole):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('ID', 'Name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.role_name,
|
||||
), )
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, tuple(data))
|
||||
|
||||
def test_role_list_domain_user(self):
|
||||
arglist = [
|
||||
|
@ -26,6 +26,15 @@ class TestRoleAssignment(identity_fakes.TestIdentityv3):
|
||||
|
||||
class TestRoleAssignmentList(TestRoleAssignment):
|
||||
|
||||
columns = (
|
||||
'Role',
|
||||
'User',
|
||||
'Group',
|
||||
'Project',
|
||||
'Domain',
|
||||
'Inherited',
|
||||
)
|
||||
|
||||
def setUp(self):
|
||||
super(TestRoleAssignment, self).setUp()
|
||||
|
||||
@ -89,8 +98,7 @@ class TestRoleAssignmentList(TestRoleAssignment):
|
||||
project=None,
|
||||
os_inherit_extension_inherited_to=None)
|
||||
|
||||
collist = ('Role', 'User', 'Group', 'Project', 'Domain', 'Inherited')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(self.columns, columns)
|
||||
datalist = ((
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.user_id,
|
||||
@ -150,8 +158,7 @@ class TestRoleAssignmentList(TestRoleAssignment):
|
||||
effective=False,
|
||||
os_inherit_extension_inherited_to=None)
|
||||
|
||||
collist = ('Role', 'User', 'Group', 'Project', 'Domain', 'Inherited')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(self.columns, columns)
|
||||
datalist = ((
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.user_id,
|
||||
@ -211,8 +218,7 @@ class TestRoleAssignmentList(TestRoleAssignment):
|
||||
user=None,
|
||||
os_inherit_extension_inherited_to=None)
|
||||
|
||||
collist = ('Role', 'User', 'Group', 'Project', 'Domain', 'Inherited')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(self.columns, columns)
|
||||
datalist = ((
|
||||
identity_fakes.role_id,
|
||||
'',
|
||||
@ -272,8 +278,7 @@ class TestRoleAssignmentList(TestRoleAssignment):
|
||||
user=None,
|
||||
os_inherit_extension_inherited_to=None)
|
||||
|
||||
collist = ('Role', 'User', 'Group', 'Project', 'Domain', 'Inherited')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(self.columns, columns)
|
||||
datalist = ((
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.user_id,
|
||||
@ -333,8 +338,7 @@ class TestRoleAssignmentList(TestRoleAssignment):
|
||||
user=None,
|
||||
os_inherit_extension_inherited_to=None)
|
||||
|
||||
collist = ('Role', 'User', 'Group', 'Project', 'Domain', 'Inherited')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(self.columns, columns)
|
||||
datalist = ((
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.user_id,
|
||||
@ -392,8 +396,7 @@ class TestRoleAssignmentList(TestRoleAssignment):
|
||||
user=None,
|
||||
os_inherit_extension_inherited_to=None)
|
||||
|
||||
collist = ('Role', 'User', 'Group', 'Project', 'Domain', 'Inherited')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(self.columns, columns)
|
||||
datalist = ((
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.user_id,
|
||||
@ -453,8 +456,7 @@ class TestRoleAssignmentList(TestRoleAssignment):
|
||||
user=None,
|
||||
os_inherit_extension_inherited_to='projects')
|
||||
|
||||
collist = ('Role', 'User', 'Group', 'Project', 'Domain', 'Inherited')
|
||||
self.assertEqual(columns, collist)
|
||||
self.assertEqual(self.columns, columns)
|
||||
datalist = ((
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.user_id,
|
||||
|
@ -32,6 +32,21 @@ class TestService(identity_fakes.TestIdentityv3):
|
||||
|
||||
class TestServiceCreate(TestService):
|
||||
|
||||
columns = (
|
||||
'description',
|
||||
'enabled',
|
||||
'id',
|
||||
'name',
|
||||
'type',
|
||||
)
|
||||
datalist = (
|
||||
identity_fakes.service_description,
|
||||
True,
|
||||
identity_fakes.service_id,
|
||||
identity_fakes.service_name,
|
||||
identity_fakes.service_type,
|
||||
)
|
||||
|
||||
def setUp(self):
|
||||
super(TestServiceCreate, self).setUp()
|
||||
|
||||
@ -69,16 +84,8 @@ class TestServiceCreate(TestService):
|
||||
enabled=True,
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id', 'name', 'type')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.service_description,
|
||||
True,
|
||||
identity_fakes.service_id,
|
||||
identity_fakes.service_name,
|
||||
identity_fakes.service_type,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_service_create_description(self):
|
||||
arglist = [
|
||||
@ -105,16 +112,8 @@ class TestServiceCreate(TestService):
|
||||
enabled=True,
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id', 'name', 'type')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.service_description,
|
||||
True,
|
||||
identity_fakes.service_id,
|
||||
identity_fakes.service_name,
|
||||
identity_fakes.service_type,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_service_create_enable(self):
|
||||
arglist = [
|
||||
@ -141,16 +140,8 @@ class TestServiceCreate(TestService):
|
||||
enabled=True,
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id', 'name', 'type')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.service_description,
|
||||
True,
|
||||
identity_fakes.service_id,
|
||||
identity_fakes.service_name,
|
||||
identity_fakes.service_type,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_service_create_disable(self):
|
||||
arglist = [
|
||||
@ -177,16 +168,8 @@ class TestServiceCreate(TestService):
|
||||
enabled=False,
|
||||
)
|
||||
|
||||
collist = ('description', 'enabled', 'id', 'name', 'type')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.service_description,
|
||||
True,
|
||||
identity_fakes.service_id,
|
||||
identity_fakes.service_name,
|
||||
identity_fakes.service_type,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
|
||||
class TestServiceDelete(TestService):
|
||||
|
@ -31,6 +31,21 @@ class TestServiceProvider(service_fakes.TestFederatedIdentity):
|
||||
|
||||
class TestServiceProviderCreate(TestServiceProvider):
|
||||
|
||||
columns = (
|
||||
'auth_url',
|
||||
'description',
|
||||
'enabled',
|
||||
'id',
|
||||
'sp_url',
|
||||
)
|
||||
datalist = (
|
||||
service_fakes.sp_auth_url,
|
||||
service_fakes.sp_description,
|
||||
True,
|
||||
service_fakes.sp_id,
|
||||
service_fakes.service_provider_url
|
||||
)
|
||||
|
||||
def setUp(self):
|
||||
super(TestServiceProviderCreate, self).setUp()
|
||||
|
||||
@ -67,16 +82,8 @@ class TestServiceProviderCreate(TestServiceProvider):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('auth_url', 'description', 'enabled', 'id', 'sp_url')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
service_fakes.sp_auth_url,
|
||||
service_fakes.sp_description,
|
||||
True,
|
||||
service_fakes.sp_id,
|
||||
service_fakes.service_provider_url
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_create_service_provider_description(self):
|
||||
|
||||
@ -109,16 +116,8 @@ class TestServiceProviderCreate(TestServiceProvider):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('auth_url', 'description', 'enabled', 'id', 'sp_url')
|
||||
self.assertEqual(columns, collist)
|
||||
datalist = (
|
||||
service_fakes.sp_auth_url,
|
||||
service_fakes.sp_description,
|
||||
True,
|
||||
service_fakes.sp_id,
|
||||
service_fakes.service_provider_url
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_create_service_provider_disabled(self):
|
||||
|
||||
@ -155,9 +154,7 @@ class TestServiceProviderCreate(TestServiceProvider):
|
||||
id=service_fakes.sp_id,
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('auth_url', 'description', 'enabled', 'id', 'sp_url')
|
||||
self.assertEqual(collist, collist)
|
||||
self.assertEqual(self.columns, columns)
|
||||
datalist = (
|
||||
service_fakes.sp_auth_url,
|
||||
None,
|
||||
@ -282,6 +279,21 @@ class TestServiceProviderShow(TestServiceProvider):
|
||||
|
||||
class TestServiceProviderSet(TestServiceProvider):
|
||||
|
||||
columns = (
|
||||
'auth_url',
|
||||
'description',
|
||||
'enabled',
|
||||
'id',
|
||||
'sp_url',
|
||||
)
|
||||
datalist = (
|
||||
service_fakes.sp_auth_url,
|
||||
service_fakes.sp_description,
|
||||
False,
|
||||
service_fakes.sp_id,
|
||||
service_fakes.service_provider_url,
|
||||
)
|
||||
|
||||
def setUp(self):
|
||||
super(TestServiceProviderSet, self).setUp()
|
||||
self.cmd = service_provider.SetServiceProvider(self.app, None)
|
||||
@ -321,16 +333,8 @@ class TestServiceProviderSet(TestServiceProvider):
|
||||
sp_url=None
|
||||
)
|
||||
|
||||
collist = ('auth_url', 'description', 'enabled', 'id', 'sp_url')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
service_fakes.sp_auth_url,
|
||||
service_fakes.sp_description,
|
||||
False,
|
||||
service_fakes.sp_id,
|
||||
service_fakes.service_provider_url
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_service_provider_enable(self):
|
||||
"""Enable Service Provider.
|
||||
@ -361,8 +365,7 @@ class TestServiceProviderSet(TestServiceProvider):
|
||||
self.service_providers_mock.update.assert_called_with(
|
||||
service_fakes.sp_id, enabled=True, description=None,
|
||||
auth_url=None, sp_url=None)
|
||||
collist = ('auth_url', 'description', 'enabled', 'id', 'sp_url')
|
||||
self.assertEqual(collist, columns)
|
||||
self.assertEqual(self.columns, columns)
|
||||
datalist = (
|
||||
service_fakes.sp_auth_url,
|
||||
service_fakes.sp_description,
|
||||
@ -370,7 +373,7 @@ class TestServiceProviderSet(TestServiceProvider):
|
||||
service_fakes.sp_id,
|
||||
service_fakes.service_provider_url
|
||||
)
|
||||
self.assertEqual(data, datalist)
|
||||
self.assertEqual(datalist, data)
|
||||
|
||||
def test_service_provider_no_options(self):
|
||||
def prepare(self):
|
||||
@ -408,5 +411,5 @@ class TestServiceProviderSet(TestServiceProvider):
|
||||
# expect take_action() to return (None, None) as none of --disabled,
|
||||
# --enabled, --description, --service-provider-url, --auth_url option
|
||||
# was set.
|
||||
self.assertEqual(columns, None)
|
||||
self.assertEqual(data, None)
|
||||
self.assertIsNone(columns)
|
||||
self.assertIsNone(data)
|
||||
|
@ -52,6 +52,23 @@ class TestUser(identity_fakes.TestIdentityv3):
|
||||
|
||||
class TestUserCreate(TestUser):
|
||||
|
||||
columns = (
|
||||
'default_project_id',
|
||||
'domain_id',
|
||||
'email',
|
||||
'enabled',
|
||||
'id',
|
||||
'name',
|
||||
)
|
||||
datalist = (
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.domain_id,
|
||||
identity_fakes.user_email,
|
||||
True,
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
)
|
||||
|
||||
def setUp(self):
|
||||
super(TestUserCreate, self).setUp()
|
||||
|
||||
@ -107,18 +124,8 @@ class TestUserCreate(TestUser):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('default_project_id', 'domain_id', 'email',
|
||||
'enabled', 'id', 'name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.domain_id,
|
||||
identity_fakes.user_email,
|
||||
True,
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_user_create_password(self):
|
||||
arglist = [
|
||||
@ -152,19 +159,8 @@ class TestUserCreate(TestUser):
|
||||
self.users_mock.create.assert_called_with(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('default_project_id', 'domain_id', 'email',
|
||||
'enabled', 'id', 'name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.domain_id,
|
||||
identity_fakes.user_email,
|
||||
True,
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_user_create_password_prompt(self):
|
||||
arglist = [
|
||||
@ -202,18 +198,8 @@ class TestUserCreate(TestUser):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('default_project_id', 'domain_id', 'email',
|
||||
'enabled', 'id', 'name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.domain_id,
|
||||
identity_fakes.user_email,
|
||||
True,
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_user_create_email(self):
|
||||
arglist = [
|
||||
@ -247,18 +233,8 @@ class TestUserCreate(TestUser):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('default_project_id', 'domain_id', 'email',
|
||||
'enabled', 'id', 'name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.domain_id,
|
||||
identity_fakes.user_email,
|
||||
True,
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_user_create_project(self):
|
||||
# Return the new project
|
||||
@ -307,9 +283,7 @@ class TestUserCreate(TestUser):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('default_project_id', 'domain_id', 'email',
|
||||
'enabled', 'id', 'name')
|
||||
self.assertEqual(collist, columns)
|
||||
self.assertEqual(self.columns, columns)
|
||||
datalist = (
|
||||
identity_fakes.PROJECT_2['id'],
|
||||
identity_fakes.domain_id,
|
||||
@ -369,9 +343,7 @@ class TestUserCreate(TestUser):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('default_project_id', 'domain_id', 'email',
|
||||
'enabled', 'id', 'name')
|
||||
self.assertEqual(collist, columns)
|
||||
self.assertEqual(self.columns, columns)
|
||||
datalist = (
|
||||
identity_fakes.PROJECT_2['id'],
|
||||
identity_fakes.domain_id,
|
||||
@ -414,18 +386,8 @@ class TestUserCreate(TestUser):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('default_project_id', 'domain_id', 'email',
|
||||
'enabled', 'id', 'name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.domain_id,
|
||||
identity_fakes.user_email,
|
||||
True,
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_user_create_enable(self):
|
||||
arglist = [
|
||||
@ -458,18 +420,8 @@ class TestUserCreate(TestUser):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('default_project_id', 'domain_id', 'email',
|
||||
'enabled', 'id', 'name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.domain_id,
|
||||
identity_fakes.user_email,
|
||||
True,
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
def test_user_create_disable(self):
|
||||
arglist = [
|
||||
@ -500,19 +452,8 @@ class TestUserCreate(TestUser):
|
||||
self.users_mock.create.assert_called_with(
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ('default_project_id', 'domain_id', 'email',
|
||||
'enabled', 'id', 'name')
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = (
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.domain_id,
|
||||
identity_fakes.user_email,
|
||||
True,
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
)
|
||||
self.assertEqual(datalist, data)
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, data)
|
||||
|
||||
|
||||
class TestUserDelete(TestUser):
|
||||
@ -550,6 +491,17 @@ class TestUserDelete(TestUser):
|
||||
|
||||
class TestUserList(TestUser):
|
||||
|
||||
columns = [
|
||||
'ID',
|
||||
'Name'
|
||||
]
|
||||
datalist = (
|
||||
(
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
),
|
||||
)
|
||||
|
||||
def setUp(self):
|
||||
super(TestUserList, self).setUp()
|
||||
|
||||
@ -614,13 +566,8 @@ class TestUserList(TestUser):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ['ID', 'Name']
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
), )
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, tuple(data))
|
||||
|
||||
def test_user_list_domain(self):
|
||||
arglist = [
|
||||
@ -644,13 +591,8 @@ class TestUserList(TestUser):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ['ID', 'Name']
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
), )
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, tuple(data))
|
||||
|
||||
def test_user_list_group(self):
|
||||
arglist = [
|
||||
@ -674,13 +616,8 @@ class TestUserList(TestUser):
|
||||
**kwargs
|
||||
)
|
||||
|
||||
collist = ['ID', 'Name']
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
), )
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, tuple(data))
|
||||
|
||||
def test_user_list_long(self):
|
||||
arglist = [
|
||||
@ -714,15 +651,17 @@ class TestUserList(TestUser):
|
||||
'Enabled',
|
||||
]
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.domain_id,
|
||||
'',
|
||||
identity_fakes.user_email,
|
||||
True,
|
||||
), )
|
||||
datalist = (
|
||||
(
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
identity_fakes.project_id,
|
||||
identity_fakes.domain_id,
|
||||
'',
|
||||
identity_fakes.user_email,
|
||||
True,
|
||||
),
|
||||
)
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
|
||||
def test_user_list_project(self):
|
||||
@ -744,13 +683,8 @@ class TestUserList(TestUser):
|
||||
self.role_assignments_mock.list.assert_called_with(**kwargs)
|
||||
self.users_mock.get.assert_called_with(identity_fakes.user_id)
|
||||
|
||||
collist = ['ID', 'Name']
|
||||
self.assertEqual(collist, columns)
|
||||
datalist = ((
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.user_name,
|
||||
), )
|
||||
self.assertEqual(datalist, tuple(data))
|
||||
self.assertEqual(self.columns, columns)
|
||||
self.assertEqual(self.datalist, tuple(data))
|
||||
|
||||
|
||||
class TestUserSet(TestUser):
|
||||
|
Loading…
Reference in New Issue
Block a user