Merge "Changed the abstract columns and datalists from test cases of common and Identity"

This commit is contained in:
Jenkins 2016-01-14 16:33:16 +00:00 committed by Gerrit Code Review
commit 8654e3e366
19 changed files with 562 additions and 814 deletions

View File

@ -18,6 +18,21 @@ from openstackclient.tests import utils
class TestConfiguration(utils.TestCommand): 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): def test_show(self):
arglist = [] arglist = []
verifylist = [('mask', True)] verifylist = [('mask', True)]
@ -26,17 +41,8 @@ class TestConfiguration(utils.TestCommand):
columns, data = cmd.take_action(parsed_args) columns, data = cmd.take_action(parsed_args)
collist = ('auth.password', 'auth.token', 'auth.username', self.assertEqual(self.columns, columns)
'identity_api_version', 'region') self.assertEqual(self.datalist, data)
self.assertEqual(collist, columns)
datalist = (
configuration.REDACTED,
configuration.REDACTED,
fakes.USERNAME,
fakes.VERSION,
fakes.REGION_NAME,
)
self.assertEqual(datalist, tuple(data))
def test_show_unmask(self): def test_show_unmask(self):
arglist = ['--unmask'] arglist = ['--unmask']
@ -46,9 +52,7 @@ class TestConfiguration(utils.TestCommand):
columns, data = cmd.take_action(parsed_args) columns, data = cmd.take_action(parsed_args)
collist = ('auth.password', 'auth.token', 'auth.username', self.assertEqual(self.columns, columns)
'identity_api_version', 'region')
self.assertEqual(collist, columns)
datalist = ( datalist = (
fakes.PASSWORD, fakes.PASSWORD,
fakes.AUTH_TOKEN, fakes.AUTH_TOKEN,
@ -56,7 +60,7 @@ class TestConfiguration(utils.TestCommand):
fakes.VERSION, fakes.VERSION,
fakes.REGION_NAME, fakes.REGION_NAME,
) )
self.assertEqual(datalist, tuple(data)) self.assertEqual(datalist, data)
def test_show_mask(self): def test_show_mask(self):
arglist = ['--mask'] arglist = ['--mask']
@ -66,14 +70,5 @@ class TestConfiguration(utils.TestCommand):
columns, data = cmd.take_action(parsed_args) columns, data = cmd.take_action(parsed_args)
collist = ('auth.password', 'auth.token', 'auth.username', self.assertEqual(self.columns, columns)
'identity_api_version', 'region') self.assertEqual(self.datalist, data)
self.assertEqual(collist, columns)
datalist = (
configuration.REDACTED,
configuration.REDACTED,
fakes.USERNAME,
fakes.VERSION,
fakes.REGION_NAME,
)
self.assertEqual(datalist, tuple(data))

View File

@ -42,6 +42,8 @@ class TestExtension(utils.TestCommand):
class TestExtensionList(TestExtension): class TestExtensionList(TestExtension):
columns = ('Name', 'Alias', 'Description')
def setUp(self): def setUp(self):
super(TestExtensionList, self).setUp() super(TestExtensionList, self).setUp()
@ -67,8 +69,7 @@ class TestExtensionList(TestExtension):
# no args should output from all services # no args should output from all services
self.identity_extensions_mock.list.assert_called_with() self.identity_extensions_mock.list.assert_called_with()
collist = ('Name', 'Alias', 'Description') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns)
datalist = ( datalist = (
( (
identity_fakes.extension_name, identity_fakes.extension_name,
@ -135,8 +136,7 @@ class TestExtensionList(TestExtension):
self.identity_extensions_mock.list.assert_called_with() self.identity_extensions_mock.list.assert_called_with()
collist = ('Name', 'Alias', 'Description') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns)
datalist = (( datalist = ((
identity_fakes.extension_name, identity_fakes.extension_name,
identity_fakes.extension_alias, identity_fakes.extension_alias,
@ -157,8 +157,7 @@ class TestExtensionList(TestExtension):
self.network_extensions_mock.assert_called_with() self.network_extensions_mock.assert_called_with()
collist = ('Name', 'Alias', 'Description') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns)
datalist = ( datalist = (
( (
network_fakes.extension_name, network_fakes.extension_name,

View File

@ -33,6 +33,11 @@ class FakeGenericClient(object):
class TestTiming(utils.TestCommand): class TestTiming(utils.TestCommand):
columns = (
'URL',
'Seconds',
)
def setUp(self): def setUp(self):
super(TestTiming, self).setUp() super(TestTiming, self).setUp()
@ -59,8 +64,7 @@ class TestTiming(utils.TestCommand):
# DisplayCommandBase.take_action() returns two tuples # DisplayCommandBase.take_action() returns two tuples
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
collist = ('URL', 'Seconds') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns)
datalist = [ datalist = [
('Total', 0.0,) ('Total', 0.0,)
] ]
@ -78,9 +82,7 @@ class TestTiming(utils.TestCommand):
# DisplayCommandBase.take_action() returns two tuples # DisplayCommandBase.take_action() returns two tuples
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
self.assertEqual(self.columns, columns)
collist = ('URL', 'Seconds')
self.assertEqual(collist, columns)
datalist = [ datalist = [
(timing_url, timing_elapsed), (timing_url, timing_elapsed),
('Total', timing_elapsed), ('Total', timing_elapsed),

View File

@ -55,6 +55,12 @@ class TestCatalog(utils.TestCommand):
class TestCatalogList(TestCatalog): class TestCatalogList(TestCatalog):
columns = (
'Name',
'Type',
'Endpoints',
)
def setUp(self): def setUp(self):
super(TestCatalogList, self).setUp() super(TestCatalogList, self).setUp()
@ -70,8 +76,7 @@ class TestCatalogList(TestCatalog):
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
self.sc_mock.service_catalog.get_data.assert_called_with() self.sc_mock.service_catalog.get_data.assert_called_with()
collist = ('Name', 'Type', 'Endpoints') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns)
datalist = (( datalist = ((
'supernova', 'supernova',
'compute', 'compute',
@ -113,8 +118,7 @@ class TestCatalogList(TestCatalog):
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
self.sc_mock.service_catalog.get_data.assert_called_with() self.sc_mock.service_catalog.get_data.assert_called_with()
collist = ('Name', 'Type', 'Endpoints') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns)
datalist = (( datalist = ((
'supernova', 'supernova',
'compute', 'compute',

View File

@ -34,6 +34,19 @@ class TestProject(identity_fakes.TestIdentityv2):
class TestProjectCreate(TestProject): 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): def setUp(self):
super(TestProjectCreate, self).setUp() super(TestProjectCreate, self).setUp()
@ -69,16 +82,8 @@ class TestProjectCreate(TestProject):
identity_fakes.project_name, identity_fakes.project_name,
**kwargs **kwargs
) )
self.assertEqual(self.columns, columns)
collist = ('description', 'enabled', 'id', 'name') self.assertEqual(self.datalist, data)
self.assertEqual(collist, columns)
datalist = (
identity_fakes.project_description,
True,
identity_fakes.project_id,
identity_fakes.project_name,
)
self.assertEqual(datalist, data)
def test_project_create_description(self): def test_project_create_description(self):
arglist = [ arglist = [
@ -104,15 +109,8 @@ class TestProjectCreate(TestProject):
**kwargs **kwargs
) )
collist = ('description', 'enabled', 'id', 'name') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.project_description,
True,
identity_fakes.project_id,
identity_fakes.project_name,
)
self.assertEqual(datalist, data)
def test_project_create_enable(self): def test_project_create_enable(self):
arglist = [ arglist = [
@ -139,15 +137,8 @@ class TestProjectCreate(TestProject):
**kwargs **kwargs
) )
collist = ('description', 'enabled', 'id', 'name') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.project_description,
True,
identity_fakes.project_id,
identity_fakes.project_name,
)
self.assertEqual(datalist, data)
def test_project_create_disable(self): def test_project_create_disable(self):
arglist = [ arglist = [
@ -174,15 +165,8 @@ class TestProjectCreate(TestProject):
**kwargs **kwargs
) )
collist = ('description', 'enabled', 'id', 'name') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.project_description,
True,
identity_fakes.project_id,
identity_fakes.project_name,
)
self.assertEqual(datalist, data)
def test_project_create_property(self): def test_project_create_property(self):
arglist = [ arglist = [
@ -211,15 +195,8 @@ class TestProjectCreate(TestProject):
**kwargs **kwargs
) )
collist = ('description', 'enabled', 'id', 'name') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.project_description,
True,
identity_fakes.project_id,
identity_fakes.project_name,
)
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):
@ -260,15 +237,8 @@ class TestProjectCreate(TestProject):
**kwargs **kwargs
) )
collist = ('description', 'enabled', 'id', 'name') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.project_description,
True,
identity_fakes.project_id,
identity_fakes.project_name,
)
self.assertEqual(datalist, data)
def test_project_create_or_show_not_exists(self): def test_project_create_or_show_not_exists(self):
arglist = [ arglist = [
@ -294,15 +264,8 @@ class TestProjectCreate(TestProject):
**kwargs **kwargs
) )
collist = ('description', 'enabled', 'id', 'name') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.project_description,
True,
identity_fakes.project_id,
identity_fakes.project_name,
)
self.assertEqual(datalist, data)
class TestProjectDelete(TestProject): class TestProjectDelete(TestProject):

View File

@ -107,6 +107,15 @@ class TestRoleAdd(TestRole):
class TestRoleCreate(TestRole): class TestRoleCreate(TestRole):
columns = (
'id',
'name'
)
datalist = (
identity_fakes.role_id,
identity_fakes.role_name,
)
def setUp(self): def setUp(self):
super(TestRoleCreate, self).setUp() super(TestRoleCreate, self).setUp()
@ -136,13 +145,8 @@ class TestRoleCreate(TestRole):
identity_fakes.role_name, identity_fakes.role_name,
) )
collist = ('id', 'name') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.role_id,
identity_fakes.role_name,
)
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):
@ -178,13 +182,8 @@ class TestRoleCreate(TestRole):
identity_fakes.role_name, identity_fakes.role_name,
) )
collist = ('id', 'name') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.role_id,
identity_fakes.role_name,
)
self.assertEqual(datalist, data)
def test_role_create_or_show_not_exists(self): def test_role_create_or_show_not_exists(self):
arglist = [ arglist = [
@ -205,13 +204,8 @@ class TestRoleCreate(TestRole):
identity_fakes.role_name, identity_fakes.role_name,
) )
collist = ('id', 'name') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.role_id,
identity_fakes.role_name,
)
self.assertEqual(datalist, data)
class TestRoleDelete(TestRole): class TestRoleDelete(TestRole):
@ -283,6 +277,13 @@ class TestRoleList(TestRole):
class TestUserRoleList(TestRole): class TestUserRoleList(TestRole):
columns = (
'ID',
'Name',
'Project',
'User'
)
def setUp(self): def setUp(self):
super(TestUserRoleList, self).setUp() super(TestUserRoleList, self).setUp()
@ -395,8 +396,7 @@ class TestUserRoleList(TestRole):
identity_fakes.PROJECT_2['id'], identity_fakes.PROJECT_2['id'],
) )
collist = ('ID', 'Name', 'Project', 'User') self.assertEqual(columns, columns)
self.assertEqual(collist, columns)
datalist = (( datalist = ((
identity_fakes.role_id, identity_fakes.role_id,
identity_fakes.role_name, identity_fakes.role_name,

View File

@ -32,6 +32,19 @@ class TestService(identity_fakes.TestIdentityv2):
class TestServiceCreate(TestService): 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): def setUp(self):
super(TestServiceCreate, self).setUp() super(TestServiceCreate, self).setUp()
@ -66,15 +79,8 @@ class TestServiceCreate(TestService):
None, None,
) )
collist = ('description', 'id', 'name', 'type') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.service_description,
identity_fakes.service_id,
identity_fakes.service_name,
identity_fakes.service_type,
)
self.assertEqual(datalist, data)
def test_service_create_with_type_option(self): def test_service_create_with_type_option(self):
arglist = [ arglist = [
@ -99,15 +105,8 @@ class TestServiceCreate(TestService):
None, None,
) )
collist = ('description', 'id', 'name', 'type') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.service_description,
identity_fakes.service_id,
identity_fakes.service_name,
identity_fakes.service_type,
)
self.assertEqual(datalist, data)
def test_service_create_with_name_option(self): def test_service_create_with_name_option(self):
arglist = [ arglist = [
@ -132,15 +131,8 @@ class TestServiceCreate(TestService):
None, None,
) )
collist = ('description', 'id', 'name', 'type') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.service_description,
identity_fakes.service_id,
identity_fakes.service_name,
identity_fakes.service_type,
)
self.assertEqual(datalist, data)
def test_service_create_description(self): def test_service_create_description(self):
arglist = [ arglist = [
@ -166,15 +158,8 @@ class TestServiceCreate(TestService):
identity_fakes.service_description, identity_fakes.service_description,
) )
collist = ('description', 'id', 'name', 'type') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.service_description,
identity_fakes.service_id,
identity_fakes.service_name,
identity_fakes.service_type,
)
self.assertEqual(datalist, data)
class TestServiceDelete(TestService): class TestServiceDelete(TestService):

View File

@ -39,6 +39,21 @@ class TestUser(identity_fakes.TestIdentityv2):
class TestUserCreate(TestUser): 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): def setUp(self):
super(TestUserCreate, self).setUp() super(TestUserCreate, self).setUp()
@ -84,16 +99,8 @@ class TestUserCreate(TestUser):
**kwargs **kwargs
) )
collist = ('email', 'enabled', 'id', 'name', 'project_id') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.user_email,
True,
identity_fakes.user_id,
identity_fakes.user_name,
identity_fakes.project_id,
)
self.assertEqual(datalist, data)
def test_user_create_password(self): def test_user_create_password(self):
arglist = [ arglist = [
@ -122,17 +129,8 @@ class TestUserCreate(TestUser):
None, None,
**kwargs **kwargs
) )
self.assertEqual(self.columns, columns)
collist = ('email', 'enabled', 'id', 'name', 'project_id') self.assertEqual(self.datalist, data)
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)
def test_user_create_password_prompt(self): def test_user_create_password_prompt(self):
arglist = [ arglist = [
@ -164,16 +162,8 @@ class TestUserCreate(TestUser):
**kwargs **kwargs
) )
collist = ('email', 'enabled', 'id', 'name', 'project_id') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.user_email,
True,
identity_fakes.user_id,
identity_fakes.user_name,
identity_fakes.project_id,
)
self.assertEqual(datalist, data)
def test_user_create_email(self): def test_user_create_email(self):
arglist = [ arglist = [
@ -202,16 +192,8 @@ class TestUserCreate(TestUser):
**kwargs **kwargs
) )
collist = ('email', 'enabled', 'id', 'name', 'project_id') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.user_email,
True,
identity_fakes.user_id,
identity_fakes.user_name,
identity_fakes.project_id,
)
self.assertEqual(datalist, data)
def test_user_create_project(self): def test_user_create_project(self):
# Return the new project # Return the new project
@ -255,8 +237,7 @@ class TestUserCreate(TestUser):
**kwargs **kwargs
) )
collist = ('email', 'enabled', 'id', 'name', 'project_id') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns)
datalist = ( datalist = (
identity_fakes.user_email, identity_fakes.user_email,
True, True,
@ -294,16 +275,8 @@ class TestUserCreate(TestUser):
**kwargs **kwargs
) )
collist = ('email', 'enabled', 'id', 'name', 'project_id') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.user_email,
True,
identity_fakes.user_id,
identity_fakes.user_name,
identity_fakes.project_id,
)
self.assertEqual(datalist, data)
def test_user_create_disable(self): def test_user_create_disable(self):
arglist = [ arglist = [
@ -333,16 +306,8 @@ class TestUserCreate(TestUser):
**kwargs **kwargs
) )
collist = ('email', 'enabled', 'id', 'name', 'project_id') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.user_email,
True,
identity_fakes.user_id,
identity_fakes.user_name,
identity_fakes.project_id,
)
self.assertEqual(datalist, data)
def test_user_create_or_show_exists(self): def test_user_create_or_show_exists(self):
def _raise_conflict(*args, **kwargs): def _raise_conflict(*args, **kwargs):
@ -373,16 +338,8 @@ class TestUserCreate(TestUser):
# UserManager.create(name, password, email, tenant_id=, enabled=) # UserManager.create(name, password, email, tenant_id=, enabled=)
self.users_mock.get.assert_called_with(identity_fakes.user_name) self.users_mock.get.assert_called_with(identity_fakes.user_name)
collist = ('email', 'enabled', 'id', 'name', 'project_id') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.user_email,
True,
identity_fakes.user_id,
identity_fakes.user_name,
identity_fakes.project_id,
)
self.assertEqual(datalist, data)
def test_user_create_or_show_not_exists(self): def test_user_create_or_show_not_exists(self):
arglist = [ arglist = [
@ -410,17 +367,8 @@ class TestUserCreate(TestUser):
None, None,
**kwargs **kwargs
) )
self.assertEqual(self.columns, columns)
collist = ('email', 'enabled', 'id', 'name', 'project_id') self.assertEqual(self.datalist, data)
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)
class TestUserDelete(TestUser): class TestUserDelete(TestUser):
@ -458,6 +406,17 @@ class TestUserDelete(TestUser):
class TestUserList(TestUser): class TestUserList(TestUser):
columns = (
'ID',
'Name',
)
datalist = (
(
identity_fakes.user_id,
identity_fakes.user_name,
),
)
def setUp(self): def setUp(self):
super(TestUserList, self).setUp() super(TestUserList, self).setUp()
@ -495,13 +454,8 @@ class TestUserList(TestUser):
self.users_mock.list.assert_called_with(tenant_id=None) self.users_mock.list.assert_called_with(tenant_id=None)
collist = ('ID', 'Name') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, tuple(data))
datalist = ((
identity_fakes.user_id,
identity_fakes.user_name,
), )
self.assertEqual(datalist, tuple(data))
def test_user_list_project(self): def test_user_list_project(self):
arglist = [ arglist = [
@ -518,13 +472,8 @@ class TestUserList(TestUser):
self.users_mock.list.assert_called_with(tenant_id=project_id) self.users_mock.list.assert_called_with(tenant_id=project_id)
collist = ('ID', 'Name') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, tuple(data))
datalist = ((
identity_fakes.user_id,
identity_fakes.user_name,
), )
self.assertEqual(datalist, tuple(data))
def test_user_list_long(self): def test_user_list_long(self):
arglist = [ arglist = [

View File

@ -29,6 +29,19 @@ class TestDomain(identity_fakes.TestIdentityv3):
class TestDomainCreate(TestDomain): 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): def setUp(self):
super(TestDomainCreate, self).setUp() super(TestDomainCreate, self).setUp()
@ -63,15 +76,8 @@ class TestDomainCreate(TestDomain):
**kwargs **kwargs
) )
collist = ('description', 'enabled', 'id', 'name') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.domain_description,
True,
identity_fakes.domain_id,
identity_fakes.domain_name,
)
self.assertEqual(datalist, data)
def test_domain_create_description(self): def test_domain_create_description(self):
arglist = [ arglist = [
@ -97,15 +103,8 @@ class TestDomainCreate(TestDomain):
**kwargs **kwargs
) )
collist = ('description', 'enabled', 'id', 'name') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.domain_description,
True,
identity_fakes.domain_id,
identity_fakes.domain_name,
)
self.assertEqual(datalist, data)
def test_domain_create_enable(self): def test_domain_create_enable(self):
arglist = [ arglist = [
@ -131,15 +130,8 @@ class TestDomainCreate(TestDomain):
**kwargs **kwargs
) )
collist = ('description', 'enabled', 'id', 'name') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.domain_description,
True,
identity_fakes.domain_id,
identity_fakes.domain_name,
)
self.assertEqual(datalist, data)
def test_domain_create_disable(self): def test_domain_create_disable(self):
arglist = [ arglist = [
@ -165,15 +157,8 @@ class TestDomainCreate(TestDomain):
**kwargs **kwargs
) )
collist = ('description', 'enabled', 'id', 'name') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.domain_description,
True,
identity_fakes.domain_id,
identity_fakes.domain_name,
)
self.assertEqual(datalist, data)
class TestDomainDelete(TestDomain): class TestDomainDelete(TestDomain):

View File

@ -37,6 +37,17 @@ class TestEndpoint(identity_fakes.TestIdentityv3):
class TestEndpointCreate(TestEndpoint): class TestEndpointCreate(TestEndpoint):
columns = (
'enabled',
'id',
'interface',
'region',
'service_id',
'service_name',
'service_type',
'url',
)
def setUp(self): def setUp(self):
super(TestEndpointCreate, self).setUp() super(TestEndpointCreate, self).setUp()
@ -86,9 +97,7 @@ class TestEndpointCreate(TestEndpoint):
**kwargs **kwargs
) )
collist = ('enabled', 'id', 'interface', 'region', 'service_id', self.assertEqual(self.columns, columns)
'service_name', 'service_type', 'url')
self.assertEqual(collist, columns)
datalist = ( datalist = (
True, True,
identity_fakes.endpoint_id, identity_fakes.endpoint_id,
@ -133,9 +142,7 @@ class TestEndpointCreate(TestEndpoint):
**kwargs **kwargs
) )
collist = ('enabled', 'id', 'interface', 'region', 'service_id', self.assertEqual(self.columns, columns)
'service_name', 'service_type', 'url')
self.assertEqual(collist, columns)
datalist = ( datalist = (
True, True,
identity_fakes.endpoint_id, identity_fakes.endpoint_id,
@ -179,9 +186,7 @@ class TestEndpointCreate(TestEndpoint):
**kwargs **kwargs
) )
collist = ('enabled', 'id', 'interface', 'region', 'service_id', self.assertEqual(self.columns, columns)
'service_name', 'service_type', 'url')
self.assertEqual(collist, columns)
datalist = ( datalist = (
True, True,
identity_fakes.endpoint_id, identity_fakes.endpoint_id,
@ -225,9 +230,7 @@ class TestEndpointCreate(TestEndpoint):
**kwargs **kwargs
) )
collist = ('enabled', 'id', 'interface', 'region', 'service_id', self.assertEqual(self.columns, columns)
'service_name', 'service_type', 'url')
self.assertEqual(collist, columns)
datalist = ( datalist = (
True, True,
identity_fakes.endpoint_id, identity_fakes.endpoint_id,
@ -276,6 +279,16 @@ class TestEndpointDelete(TestEndpoint):
class TestEndpointList(TestEndpoint): class TestEndpointList(TestEndpoint):
columns = (
'ID',
'Region',
'Service Name',
'Service Type',
'Enabled',
'Interface',
'URL',
)
def setUp(self): def setUp(self):
super(TestEndpointList, self).setUp() super(TestEndpointList, self).setUp()
@ -306,18 +319,18 @@ class TestEndpointList(TestEndpoint):
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
self.endpoints_mock.list.assert_called_with() self.endpoints_mock.list.assert_called_with()
collist = ('ID', 'Region', 'Service Name', 'Service Type', self.assertEqual(self.columns, columns)
'Enabled', 'Interface', 'URL') datalist = (
self.assertEqual(collist, columns) (
datalist = (( identity_fakes.endpoint_id,
identity_fakes.endpoint_id, identity_fakes.endpoint_region,
identity_fakes.endpoint_region, self.get_fake_service_name(),
self.get_fake_service_name(), identity_fakes.service_type,
identity_fakes.service_type, True,
True, identity_fakes.endpoint_interface,
identity_fakes.endpoint_interface, identity_fakes.endpoint_url,
identity_fakes.endpoint_url, ),
),) )
self.assertEqual(datalist, tuple(data)) self.assertEqual(datalist, tuple(data))
def test_endpoint_list_service(self): def test_endpoint_list_service(self):
@ -338,18 +351,18 @@ class TestEndpointList(TestEndpoint):
} }
self.endpoints_mock.list.assert_called_with(**kwargs) self.endpoints_mock.list.assert_called_with(**kwargs)
collist = ('ID', 'Region', 'Service Name', 'Service Type', self.assertEqual(self.columns, columns)
'Enabled', 'Interface', 'URL') datalist = (
self.assertEqual(collist, columns) (
datalist = (( identity_fakes.endpoint_id,
identity_fakes.endpoint_id, identity_fakes.endpoint_region,
identity_fakes.endpoint_region, self.get_fake_service_name(),
self.get_fake_service_name(), identity_fakes.service_type,
identity_fakes.service_type, True,
True, identity_fakes.endpoint_interface,
identity_fakes.endpoint_interface, identity_fakes.endpoint_url,
identity_fakes.endpoint_url, ),
),) )
self.assertEqual(datalist, tuple(data)) self.assertEqual(datalist, tuple(data))
def test_endpoint_list_interface(self): def test_endpoint_list_interface(self):
@ -370,18 +383,18 @@ class TestEndpointList(TestEndpoint):
} }
self.endpoints_mock.list.assert_called_with(**kwargs) self.endpoints_mock.list.assert_called_with(**kwargs)
collist = ('ID', 'Region', 'Service Name', 'Service Type', self.assertEqual(self.columns, columns)
'Enabled', 'Interface', 'URL') datalist = (
self.assertEqual(collist, columns) (
datalist = (( identity_fakes.endpoint_id,
identity_fakes.endpoint_id, identity_fakes.endpoint_region,
identity_fakes.endpoint_region, self.get_fake_service_name(),
self.get_fake_service_name(), identity_fakes.service_type,
identity_fakes.service_type, True,
True, identity_fakes.endpoint_interface,
identity_fakes.endpoint_interface, identity_fakes.endpoint_url,
identity_fakes.endpoint_url, ),
),) )
self.assertEqual(datalist, tuple(data)) self.assertEqual(datalist, tuple(data))
def test_endpoint_list_region(self): def test_endpoint_list_region(self):
@ -402,18 +415,18 @@ class TestEndpointList(TestEndpoint):
} }
self.endpoints_mock.list.assert_called_with(**kwargs) self.endpoints_mock.list.assert_called_with(**kwargs)
collist = ('ID', 'Region', 'Service Name', 'Service Type', self.assertEqual(self.columns, columns)
'Enabled', 'Interface', 'URL') datalist = (
self.assertEqual(collist, columns) (
datalist = (( identity_fakes.endpoint_id,
identity_fakes.endpoint_id, identity_fakes.endpoint_region,
identity_fakes.endpoint_region, self.get_fake_service_name(),
self.get_fake_service_name(), identity_fakes.service_type,
identity_fakes.service_type, True,
True, identity_fakes.endpoint_interface,
identity_fakes.endpoint_interface, identity_fakes.endpoint_url,
identity_fakes.endpoint_url, ),
),) )
self.assertEqual(datalist, tuple(data)) self.assertEqual(datalist, tuple(data))
@ -658,8 +671,16 @@ class TestEndpointShow(TestEndpoint):
identity_fakes.endpoint_id, identity_fakes.endpoint_id,
) )
collist = ('enabled', 'id', 'interface', 'region', 'service_id', collist = (
'service_name', 'service_type', 'url') 'enabled',
'id',
'interface',
'region',
'service_id',
'service_name',
'service_type',
'url',
)
self.assertEqual(collist, columns) self.assertEqual(collist, columns)
datalist = ( datalist = (
True, True,

View File

@ -38,6 +38,17 @@ class TestGroup(identity_fakes.TestIdentityv3):
class TestGroupList(TestGroup): class TestGroupList(TestGroup):
columns = (
'ID',
'Name',
)
datalist = (
(
identity_fakes.group_id,
identity_fakes.group_name,
),
)
def setUp(self): def setUp(self):
super(TestGroupList, self).setUp() super(TestGroupList, self).setUp()
@ -87,13 +98,8 @@ class TestGroupList(TestGroup):
**kwargs **kwargs
) )
collist = ('ID', 'Name') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, tuple(data))
datalist = ((
identity_fakes.group_id,
identity_fakes.group_name,
), )
self.assertEqual(datalist, tuple(data))
def test_group_list_domain(self): def test_group_list_domain(self):
arglist = [ arglist = [
@ -117,13 +123,8 @@ class TestGroupList(TestGroup):
**kwargs **kwargs
) )
collist = ('ID', 'Name') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, tuple(data))
datalist = ((
identity_fakes.group_id,
identity_fakes.group_name,
), )
self.assertEqual(datalist, tuple(data))
def test_group_list_user(self): def test_group_list_user(self):
arglist = [ arglist = [
@ -147,13 +148,8 @@ class TestGroupList(TestGroup):
**kwargs **kwargs
) )
collist = ('ID', 'Name') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, tuple(data))
datalist = ((
identity_fakes.group_id,
identity_fakes.group_name,
), )
self.assertEqual(datalist, tuple(data))
def test_group_list_long(self): def test_group_list_long(self):
arglist = [ arglist = [
@ -177,17 +173,15 @@ class TestGroupList(TestGroup):
**kwargs **kwargs
) )
collist = ( columns = self.columns + (
'ID',
'Name',
'Domain ID', 'Domain ID',
'Description', 'Description',
) )
self.assertEqual(collist, columns)
datalist = (( datalist = ((
identity_fakes.group_id, identity_fakes.group_id,
identity_fakes.group_name, identity_fakes.group_name,
'', '',
'', '',
), ) ), )
self.assertEqual(columns, columns)
self.assertEqual(datalist, tuple(data)) self.assertEqual(datalist, tuple(data))

View File

@ -33,6 +33,19 @@ class TestIdentityProvider(identity_fakes.TestFederatedIdentity):
class TestIdentityProviderCreate(TestIdentityProvider): 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): def setUp(self):
super(TestIdentityProviderCreate, self).setUp() super(TestIdentityProviderCreate, self).setUp()
@ -63,15 +76,8 @@ class TestIdentityProviderCreate(TestIdentityProvider):
**kwargs **kwargs
) )
collist = ('description', 'enabled', 'id', 'remote_ids') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.idp_description,
True,
identity_fakes.idp_id,
identity_fakes.formatted_idp_remote_ids
)
self.assertEqual(datalist, data)
def test_create_identity_provider_description(self): def test_create_identity_provider_description(self):
arglist = [ arglist = [
@ -97,15 +103,8 @@ class TestIdentityProviderCreate(TestIdentityProvider):
**kwargs **kwargs
) )
collist = ('description', 'enabled', 'id', 'remote_ids') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.idp_description,
True,
identity_fakes.idp_id,
identity_fakes.formatted_idp_remote_ids
)
self.assertEqual(datalist, data)
def test_create_identity_provider_remote_id(self): def test_create_identity_provider_remote_id(self):
arglist = [ arglist = [
@ -131,15 +130,8 @@ class TestIdentityProviderCreate(TestIdentityProvider):
**kwargs **kwargs
) )
collist = ('description', 'enabled', 'id', 'remote_ids') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.idp_description,
True,
identity_fakes.idp_id,
identity_fakes.formatted_idp_remote_ids
)
self.assertEqual(datalist, data)
def test_create_identity_provider_remote_ids_multiple(self): def test_create_identity_provider_remote_ids_multiple(self):
arglist = [ arglist = [
@ -166,15 +158,8 @@ class TestIdentityProviderCreate(TestIdentityProvider):
**kwargs **kwargs
) )
collist = ('description', 'enabled', 'id', 'remote_ids') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.idp_description,
True,
identity_fakes.idp_id,
identity_fakes.formatted_idp_remote_ids
)
self.assertEqual(datalist, data)
def test_create_identity_provider_remote_ids_file(self): def test_create_identity_provider_remote_ids_file(self):
arglist = [ arglist = [
@ -205,15 +190,8 @@ class TestIdentityProviderCreate(TestIdentityProvider):
**kwargs **kwargs
) )
collist = ('description', 'enabled', 'id', 'remote_ids') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.idp_description,
True,
identity_fakes.idp_id,
identity_fakes.formatted_idp_remote_ids
)
self.assertEqual(datalist, data)
def test_create_identity_provider_disabled(self): def test_create_identity_provider_disabled(self):
@ -247,8 +225,7 @@ class TestIdentityProviderCreate(TestIdentityProvider):
**kwargs **kwargs
) )
collist = ('description', 'enabled', 'id', 'remote_ids') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns)
datalist = ( datalist = (
None, None,
False, False,
@ -370,6 +347,19 @@ class TestIdentityProviderShow(TestIdentityProvider):
class TestIdentityProviderSet(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): def setUp(self):
super(TestIdentityProviderSet, self).setUp() super(TestIdentityProviderSet, self).setUp()
self.cmd = identity_provider.SetIdentityProvider(self.app, None) self.cmd = identity_provider.SetIdentityProvider(self.app, None)
@ -401,15 +391,12 @@ class TestIdentityProviderSet(TestIdentityProvider):
('remote_id', None) ('remote_id', None)
] ]
parsed_args = self.check_parser(self.cmd, arglist, verifylist) parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
self.identity_providers_mock.update.assert_called_with( self.identity_providers_mock.update.assert_called_with(
identity_fakes.idp_id, identity_fakes.idp_id,
description=new_description description=new_description,
) )
self.assertEqual(self.columns, columns)
collist = ('description', 'enabled', 'id', 'remote_ids')
self.assertEqual(collist, columns)
datalist = ( datalist = (
identity_fakes.idp_description, identity_fakes.idp_description,
False, False,
@ -456,8 +443,7 @@ class TestIdentityProviderSet(TestIdentityProvider):
remote_ids=identity_fakes.idp_remote_ids remote_ids=identity_fakes.idp_remote_ids
) )
collist = ('description', 'enabled', 'id', 'remote_ids') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns)
datalist = ( datalist = (
identity_fakes.idp_description, identity_fakes.idp_description,
False, False,
@ -499,15 +485,8 @@ 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,
remote_ids=identity_fakes.idp_remote_ids) remote_ids=identity_fakes.idp_remote_ids)
collist = ('description', 'enabled', 'id', 'remote_ids') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.idp_description,
True,
identity_fakes.idp_id,
identity_fakes.idp_remote_ids
)
self.assertEqual(datalist, data)
def test_identity_provider_replace_remote_ids(self): def test_identity_provider_replace_remote_ids(self):
"""Enable Identity Provider. """Enable Identity Provider.
@ -545,8 +524,7 @@ 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,
remote_ids=[self.new_remote_id]) remote_ids=[self.new_remote_id])
collist = ('description', 'enabled', 'id', 'remote_ids') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns)
datalist = ( datalist = (
identity_fakes.idp_description, identity_fakes.idp_description,
True, True,
@ -595,8 +573,7 @@ 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,
remote_ids=[self.new_remote_id]) remote_ids=[self.new_remote_id])
collist = ('description', 'enabled', 'id', 'remote_ids') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns)
datalist = ( datalist = (
identity_fakes.idp_description, identity_fakes.idp_description,
True, True,

View File

@ -38,6 +38,21 @@ class TestProject(identity_fakes.TestIdentityv3):
class TestProjectCreate(TestProject): 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): def setUp(self):
super(TestProjectCreate, self).setUp() super(TestProjectCreate, self).setUp()
@ -127,16 +142,8 @@ class TestProjectCreate(TestProject):
**kwargs **kwargs
) )
collist = ('description', 'domain_id', 'enabled', 'id', 'name') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.project_description,
identity_fakes.domain_id,
True,
identity_fakes.project_id,
identity_fakes.project_name,
)
self.assertEqual(datalist, data)
def test_project_create_domain(self): def test_project_create_domain(self):
arglist = [ arglist = [
@ -169,16 +176,8 @@ class TestProjectCreate(TestProject):
**kwargs **kwargs
) )
collist = ('description', 'domain_id', 'enabled', 'id', 'name') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.project_description,
identity_fakes.domain_id,
True,
identity_fakes.project_id,
identity_fakes.project_name,
)
self.assertEqual(datalist, data)
def test_project_create_domain_no_perms(self): def test_project_create_domain_no_perms(self):
arglist = [ arglist = [
@ -210,16 +209,8 @@ class TestProjectCreate(TestProject):
self.projects_mock.create.assert_called_with( self.projects_mock.create.assert_called_with(
**kwargs **kwargs
) )
collist = ('description', 'domain_id', 'enabled', 'id', 'name') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.project_description,
identity_fakes.domain_id,
True,
identity_fakes.project_id,
identity_fakes.project_name,
)
self.assertEqual(datalist, data)
def test_project_create_enable(self): def test_project_create_enable(self):
arglist = [ arglist = [
@ -251,16 +242,8 @@ class TestProjectCreate(TestProject):
**kwargs **kwargs
) )
collist = ('description', 'domain_id', 'enabled', 'id', 'name') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.project_description,
identity_fakes.domain_id,
True,
identity_fakes.project_id,
identity_fakes.project_name,
)
self.assertEqual(datalist, data)
def test_project_create_disable(self): def test_project_create_disable(self):
arglist = [ arglist = [
@ -292,16 +275,8 @@ class TestProjectCreate(TestProject):
**kwargs **kwargs
) )
collist = ('description', 'domain_id', 'enabled', 'id', 'name') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.project_description,
identity_fakes.domain_id,
True,
identity_fakes.project_id,
identity_fakes.project_name,
)
self.assertEqual(datalist, data)
def test_project_create_property(self): def test_project_create_property(self):
arglist = [ arglist = [
@ -334,16 +309,8 @@ class TestProjectCreate(TestProject):
**kwargs **kwargs
) )
collist = ('description', 'domain_id', 'enabled', 'id', 'name') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.project_description,
identity_fakes.domain_id,
True,
identity_fakes.project_id,
identity_fakes.project_name,
)
self.assertEqual(datalist, data)
def test_project_create_parent(self): def test_project_create_parent(self):
self.projects_mock.get.return_value = fakes.FakeResource( self.projects_mock.get.return_value = fakes.FakeResource(
@ -467,6 +434,17 @@ class TestProjectDelete(TestProject):
class TestProjectList(TestProject): class TestProjectList(TestProject):
columns = (
'ID',
'Name',
)
datalist = (
(
identity_fakes.project_id,
identity_fakes.project_name,
),
)
def setUp(self): def setUp(self):
super(TestProjectList, self).setUp() super(TestProjectList, self).setUp()
@ -490,13 +468,8 @@ class TestProjectList(TestProject):
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
self.projects_mock.list.assert_called_with() self.projects_mock.list.assert_called_with()
collist = ('ID', 'Name') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, tuple(data))
datalist = ((
identity_fakes.project_id,
identity_fakes.project_name,
), )
self.assertEqual(datalist, tuple(data))
def test_project_list_long(self): def test_project_list_long(self):
arglist = [ arglist = [
@ -543,13 +516,8 @@ 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') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, tuple(data))
datalist = ((
identity_fakes.project_id,
identity_fakes.project_name,
), )
self.assertEqual(datalist, tuple(data))
def test_project_list_domain_no_perms(self): def test_project_list_domain_no_perms(self):
arglist = [ arglist = [
@ -567,13 +535,8 @@ 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') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, tuple(data))
datalist = ((
identity_fakes.project_id,
identity_fakes.project_name,
), )
self.assertEqual(datalist, tuple(data))
class TestProjectSet(TestProject): class TestProjectSet(TestProject):

View File

@ -30,6 +30,17 @@ class TestRegion(identity_fakes.TestIdentityv3):
class TestRegionCreate(TestRegion): 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): def setUp(self):
super(TestRegionCreate, self).setUp() super(TestRegionCreate, self).setUp()
@ -66,14 +77,8 @@ class TestRegionCreate(TestRegion):
**kwargs **kwargs
) )
collist = ('description', 'parent_region', 'region') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.region_description,
identity_fakes.region_parent_region_id,
identity_fakes.region_id,
)
self.assertEqual(datalist, data)
def test_region_create_no_options(self): def test_region_create_no_options(self):
arglist = [ arglist = [
@ -97,14 +102,8 @@ class TestRegionCreate(TestRegion):
**kwargs **kwargs
) )
collist = ('description', 'parent_region', 'region') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.region_description,
identity_fakes.region_parent_region_id,
identity_fakes.region_id,
)
self.assertEqual(datalist, data)
def test_region_create_parent_region_id(self): def test_region_create_parent_region_id(self):
arglist = [ arglist = [
@ -129,15 +128,8 @@ class TestRegionCreate(TestRegion):
self.regions_mock.create.assert_called_with( self.regions_mock.create.assert_called_with(
**kwargs **kwargs
) )
self.assertEqual(self.columns, columns)
collist = ('description', 'parent_region', 'region') self.assertEqual(self.datalist, data)
self.assertEqual(collist, columns)
datalist = (
identity_fakes.region_description,
identity_fakes.region_parent_region_id,
identity_fakes.region_id,
)
self.assertEqual(datalist, data)
class TestRegionDelete(TestRegion): class TestRegionDelete(TestRegion):
@ -169,6 +161,19 @@ class TestRegionDelete(TestRegion):
class TestRegionList(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): def setUp(self):
super(TestRegionList, self).setUp() super(TestRegionList, self).setUp()
@ -192,14 +197,8 @@ class TestRegionList(TestRegion):
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
self.regions_mock.list.assert_called_with() self.regions_mock.list.assert_called_with()
collist = ('Region', 'Parent Region', 'Description') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, tuple(data))
datalist = ((
identity_fakes.region_id,
identity_fakes.region_parent_region_id,
identity_fakes.region_description,
), )
self.assertEqual(datalist, tuple(data))
def test_region_list_parent_region_id(self): def test_region_list_parent_region_id(self):
arglist = [ arglist = [
@ -215,14 +214,8 @@ class TestRegionList(TestRegion):
self.regions_mock.list.assert_called_with( self.regions_mock.list.assert_called_with(
parent_region_id=identity_fakes.region_parent_region_id) parent_region_id=identity_fakes.region_parent_region_id)
collist = ('Region', 'Parent Region', 'Description') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, tuple(data))
datalist = ((
identity_fakes.region_id,
identity_fakes.region_parent_region_id,
identity_fakes.region_description,
), )
self.assertEqual(datalist, tuple(data))
class TestRegionSet(TestRegion): class TestRegionSet(TestRegion):

View File

@ -314,6 +314,17 @@ class TestRoleDelete(TestRole):
class TestRoleList(TestRole): class TestRoleList(TestRole):
columns = (
'ID',
'Name',
)
datalist = (
(
identity_fakes.role_id,
identity_fakes.role_name,
),
)
def setUp(self): def setUp(self):
super(TestRoleList, self).setUp() super(TestRoleList, self).setUp()
@ -359,13 +370,8 @@ class TestRoleList(TestRole):
self.roles_mock.list.assert_called_with() self.roles_mock.list.assert_called_with()
collist = ('ID', 'Name') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, tuple(data))
datalist = ((
identity_fakes.role_id,
identity_fakes.role_name,
), )
self.assertEqual(datalist, tuple(data))
def test_user_list_inherited(self): def test_user_list_inherited(self):
arglist = [ arglist = [
@ -392,13 +398,8 @@ class TestRoleList(TestRole):
**kwargs **kwargs
) )
collist = ('ID', 'Name') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, tuple(data))
datalist = ((
identity_fakes.role_id,
identity_fakes.role_name,
), )
self.assertEqual(datalist, tuple(data))
def test_user_list_user(self): def test_user_list_user(self):
arglist = [ arglist = [
@ -423,13 +424,8 @@ class TestRoleList(TestRole):
**kwargs **kwargs
) )
collist = ('ID', 'Name') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, tuple(data))
datalist = ((
identity_fakes.role_id,
identity_fakes.role_name,
), )
self.assertEqual(datalist, tuple(data))
def test_role_list_domain_user(self): def test_role_list_domain_user(self):
arglist = [ arglist = [

View File

@ -26,6 +26,15 @@ class TestRoleAssignment(identity_fakes.TestIdentityv3):
class TestRoleAssignmentList(TestRoleAssignment): class TestRoleAssignmentList(TestRoleAssignment):
columns = (
'Role',
'User',
'Group',
'Project',
'Domain',
'Inherited',
)
def setUp(self): def setUp(self):
super(TestRoleAssignment, self).setUp() super(TestRoleAssignment, self).setUp()
@ -89,8 +98,7 @@ class TestRoleAssignmentList(TestRoleAssignment):
project=None, project=None,
os_inherit_extension_inherited_to=None) os_inherit_extension_inherited_to=None)
collist = ('Role', 'User', 'Group', 'Project', 'Domain', 'Inherited') self.assertEqual(self.columns, columns)
self.assertEqual(columns, collist)
datalist = (( datalist = ((
identity_fakes.role_id, identity_fakes.role_id,
identity_fakes.user_id, identity_fakes.user_id,
@ -150,8 +158,7 @@ class TestRoleAssignmentList(TestRoleAssignment):
effective=False, effective=False,
os_inherit_extension_inherited_to=None) os_inherit_extension_inherited_to=None)
collist = ('Role', 'User', 'Group', 'Project', 'Domain', 'Inherited') self.assertEqual(self.columns, columns)
self.assertEqual(columns, collist)
datalist = (( datalist = ((
identity_fakes.role_id, identity_fakes.role_id,
identity_fakes.user_id, identity_fakes.user_id,
@ -211,8 +218,7 @@ class TestRoleAssignmentList(TestRoleAssignment):
user=None, user=None,
os_inherit_extension_inherited_to=None) os_inherit_extension_inherited_to=None)
collist = ('Role', 'User', 'Group', 'Project', 'Domain', 'Inherited') self.assertEqual(self.columns, columns)
self.assertEqual(columns, collist)
datalist = (( datalist = ((
identity_fakes.role_id, identity_fakes.role_id,
'', '',
@ -272,8 +278,7 @@ class TestRoleAssignmentList(TestRoleAssignment):
user=None, user=None,
os_inherit_extension_inherited_to=None) os_inherit_extension_inherited_to=None)
collist = ('Role', 'User', 'Group', 'Project', 'Domain', 'Inherited') self.assertEqual(self.columns, columns)
self.assertEqual(columns, collist)
datalist = (( datalist = ((
identity_fakes.role_id, identity_fakes.role_id,
identity_fakes.user_id, identity_fakes.user_id,
@ -333,8 +338,7 @@ class TestRoleAssignmentList(TestRoleAssignment):
user=None, user=None,
os_inherit_extension_inherited_to=None) os_inherit_extension_inherited_to=None)
collist = ('Role', 'User', 'Group', 'Project', 'Domain', 'Inherited') self.assertEqual(self.columns, columns)
self.assertEqual(columns, collist)
datalist = (( datalist = ((
identity_fakes.role_id, identity_fakes.role_id,
identity_fakes.user_id, identity_fakes.user_id,
@ -392,8 +396,7 @@ class TestRoleAssignmentList(TestRoleAssignment):
user=None, user=None,
os_inherit_extension_inherited_to=None) os_inherit_extension_inherited_to=None)
collist = ('Role', 'User', 'Group', 'Project', 'Domain', 'Inherited') self.assertEqual(self.columns, columns)
self.assertEqual(columns, collist)
datalist = (( datalist = ((
identity_fakes.role_id, identity_fakes.role_id,
identity_fakes.user_id, identity_fakes.user_id,
@ -453,8 +456,7 @@ class TestRoleAssignmentList(TestRoleAssignment):
user=None, user=None,
os_inherit_extension_inherited_to='projects') os_inherit_extension_inherited_to='projects')
collist = ('Role', 'User', 'Group', 'Project', 'Domain', 'Inherited') self.assertEqual(self.columns, columns)
self.assertEqual(columns, collist)
datalist = (( datalist = ((
identity_fakes.role_id, identity_fakes.role_id,
identity_fakes.user_id, identity_fakes.user_id,

View File

@ -32,6 +32,21 @@ class TestService(identity_fakes.TestIdentityv3):
class TestServiceCreate(TestService): 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): def setUp(self):
super(TestServiceCreate, self).setUp() super(TestServiceCreate, self).setUp()
@ -69,16 +84,8 @@ class TestServiceCreate(TestService):
enabled=True, enabled=True,
) )
collist = ('description', 'enabled', 'id', 'name', 'type') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.service_description,
True,
identity_fakes.service_id,
identity_fakes.service_name,
identity_fakes.service_type,
)
self.assertEqual(datalist, data)
def test_service_create_description(self): def test_service_create_description(self):
arglist = [ arglist = [
@ -105,16 +112,8 @@ class TestServiceCreate(TestService):
enabled=True, enabled=True,
) )
collist = ('description', 'enabled', 'id', 'name', 'type') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.service_description,
True,
identity_fakes.service_id,
identity_fakes.service_name,
identity_fakes.service_type,
)
self.assertEqual(datalist, data)
def test_service_create_enable(self): def test_service_create_enable(self):
arglist = [ arglist = [
@ -141,16 +140,8 @@ class TestServiceCreate(TestService):
enabled=True, enabled=True,
) )
collist = ('description', 'enabled', 'id', 'name', 'type') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.service_description,
True,
identity_fakes.service_id,
identity_fakes.service_name,
identity_fakes.service_type,
)
self.assertEqual(datalist, data)
def test_service_create_disable(self): def test_service_create_disable(self):
arglist = [ arglist = [
@ -177,16 +168,8 @@ class TestServiceCreate(TestService):
enabled=False, enabled=False,
) )
collist = ('description', 'enabled', 'id', 'name', 'type') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
identity_fakes.service_description,
True,
identity_fakes.service_id,
identity_fakes.service_name,
identity_fakes.service_type,
)
self.assertEqual(datalist, data)
class TestServiceDelete(TestService): class TestServiceDelete(TestService):

View File

@ -31,6 +31,21 @@ class TestServiceProvider(service_fakes.TestFederatedIdentity):
class TestServiceProviderCreate(TestServiceProvider): 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): def setUp(self):
super(TestServiceProviderCreate, self).setUp() super(TestServiceProviderCreate, self).setUp()
@ -67,16 +82,8 @@ class TestServiceProviderCreate(TestServiceProvider):
**kwargs **kwargs
) )
collist = ('auth_url', 'description', 'enabled', 'id', 'sp_url') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
service_fakes.sp_auth_url,
service_fakes.sp_description,
True,
service_fakes.sp_id,
service_fakes.service_provider_url
)
self.assertEqual(data, datalist)
def test_create_service_provider_description(self): def test_create_service_provider_description(self):
@ -109,16 +116,8 @@ class TestServiceProviderCreate(TestServiceProvider):
**kwargs **kwargs
) )
collist = ('auth_url', 'description', 'enabled', 'id', 'sp_url') self.assertEqual(self.columns, columns)
self.assertEqual(columns, collist) self.assertEqual(self.datalist, data)
datalist = (
service_fakes.sp_auth_url,
service_fakes.sp_description,
True,
service_fakes.sp_id,
service_fakes.service_provider_url
)
self.assertEqual(datalist, data)
def test_create_service_provider_disabled(self): def test_create_service_provider_disabled(self):
@ -155,9 +154,7 @@ class TestServiceProviderCreate(TestServiceProvider):
id=service_fakes.sp_id, id=service_fakes.sp_id,
**kwargs **kwargs
) )
self.assertEqual(self.columns, columns)
collist = ('auth_url', 'description', 'enabled', 'id', 'sp_url')
self.assertEqual(collist, collist)
datalist = ( datalist = (
service_fakes.sp_auth_url, service_fakes.sp_auth_url,
None, None,
@ -282,6 +279,21 @@ class TestServiceProviderShow(TestServiceProvider):
class TestServiceProviderSet(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): def setUp(self):
super(TestServiceProviderSet, self).setUp() super(TestServiceProviderSet, self).setUp()
self.cmd = service_provider.SetServiceProvider(self.app, None) self.cmd = service_provider.SetServiceProvider(self.app, None)
@ -321,16 +333,8 @@ class TestServiceProviderSet(TestServiceProvider):
sp_url=None sp_url=None
) )
collist = ('auth_url', 'description', 'enabled', 'id', 'sp_url') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, data)
datalist = (
service_fakes.sp_auth_url,
service_fakes.sp_description,
False,
service_fakes.sp_id,
service_fakes.service_provider_url
)
self.assertEqual(datalist, data)
def test_service_provider_enable(self): def test_service_provider_enable(self):
"""Enable Service Provider. """Enable Service Provider.
@ -361,8 +365,7 @@ class TestServiceProviderSet(TestServiceProvider):
self.service_providers_mock.update.assert_called_with( self.service_providers_mock.update.assert_called_with(
service_fakes.sp_id, enabled=True, description=None, service_fakes.sp_id, enabled=True, description=None,
auth_url=None, sp_url=None) auth_url=None, sp_url=None)
collist = ('auth_url', 'description', 'enabled', 'id', 'sp_url') self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns)
datalist = ( datalist = (
service_fakes.sp_auth_url, service_fakes.sp_auth_url,
service_fakes.sp_description, service_fakes.sp_description,
@ -370,7 +373,7 @@ class TestServiceProviderSet(TestServiceProvider):
service_fakes.sp_id, service_fakes.sp_id,
service_fakes.service_provider_url service_fakes.service_provider_url
) )
self.assertEqual(data, datalist) self.assertEqual(datalist, data)
def test_service_provider_no_options(self): def test_service_provider_no_options(self):
def prepare(self): def prepare(self):

View File

@ -52,6 +52,23 @@ class TestUser(identity_fakes.TestIdentityv3):
class TestUserCreate(TestUser): 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): def setUp(self):
super(TestUserCreate, self).setUp() super(TestUserCreate, self).setUp()
@ -107,18 +124,8 @@ class TestUserCreate(TestUser):
**kwargs **kwargs
) )
collist = ('default_project_id', 'domain_id', 'email', self.assertEqual(self.columns, columns)
'enabled', 'id', 'name') self.assertEqual(self.datalist, data)
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)
def test_user_create_password(self): def test_user_create_password(self):
arglist = [ arglist = [
@ -152,19 +159,8 @@ class TestUserCreate(TestUser):
self.users_mock.create.assert_called_with( self.users_mock.create.assert_called_with(
**kwargs **kwargs
) )
self.assertEqual(self.columns, columns)
collist = ('default_project_id', 'domain_id', 'email', self.assertEqual(self.datalist, data)
'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)
def test_user_create_password_prompt(self): def test_user_create_password_prompt(self):
arglist = [ arglist = [
@ -202,18 +198,8 @@ class TestUserCreate(TestUser):
**kwargs **kwargs
) )
collist = ('default_project_id', 'domain_id', 'email', self.assertEqual(self.columns, columns)
'enabled', 'id', 'name') self.assertEqual(self.datalist, data)
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)
def test_user_create_email(self): def test_user_create_email(self):
arglist = [ arglist = [
@ -247,18 +233,8 @@ class TestUserCreate(TestUser):
**kwargs **kwargs
) )
collist = ('default_project_id', 'domain_id', 'email', self.assertEqual(self.columns, columns)
'enabled', 'id', 'name') self.assertEqual(self.datalist, data)
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)
def test_user_create_project(self): def test_user_create_project(self):
# Return the new project # Return the new project
@ -307,9 +283,7 @@ class TestUserCreate(TestUser):
**kwargs **kwargs
) )
collist = ('default_project_id', 'domain_id', 'email', self.assertEqual(self.columns, columns)
'enabled', 'id', 'name')
self.assertEqual(collist, columns)
datalist = ( datalist = (
identity_fakes.PROJECT_2['id'], identity_fakes.PROJECT_2['id'],
identity_fakes.domain_id, identity_fakes.domain_id,
@ -369,9 +343,7 @@ class TestUserCreate(TestUser):
**kwargs **kwargs
) )
collist = ('default_project_id', 'domain_id', 'email', self.assertEqual(self.columns, columns)
'enabled', 'id', 'name')
self.assertEqual(collist, columns)
datalist = ( datalist = (
identity_fakes.PROJECT_2['id'], identity_fakes.PROJECT_2['id'],
identity_fakes.domain_id, identity_fakes.domain_id,
@ -414,18 +386,8 @@ class TestUserCreate(TestUser):
**kwargs **kwargs
) )
collist = ('default_project_id', 'domain_id', 'email', self.assertEqual(self.columns, columns)
'enabled', 'id', 'name') self.assertEqual(self.datalist, data)
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)
def test_user_create_enable(self): def test_user_create_enable(self):
arglist = [ arglist = [
@ -458,18 +420,8 @@ class TestUserCreate(TestUser):
**kwargs **kwargs
) )
collist = ('default_project_id', 'domain_id', 'email', self.assertEqual(self.columns, columns)
'enabled', 'id', 'name') self.assertEqual(self.datalist, data)
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)
def test_user_create_disable(self): def test_user_create_disable(self):
arglist = [ arglist = [
@ -500,19 +452,8 @@ class TestUserCreate(TestUser):
self.users_mock.create.assert_called_with( self.users_mock.create.assert_called_with(
**kwargs **kwargs
) )
self.assertEqual(self.columns, columns)
collist = ('default_project_id', 'domain_id', 'email', self.assertEqual(self.datalist, data)
'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)
class TestUserDelete(TestUser): class TestUserDelete(TestUser):
@ -550,6 +491,17 @@ class TestUserDelete(TestUser):
class TestUserList(TestUser): class TestUserList(TestUser):
columns = [
'ID',
'Name'
]
datalist = (
(
identity_fakes.user_id,
identity_fakes.user_name,
),
)
def setUp(self): def setUp(self):
super(TestUserList, self).setUp() super(TestUserList, self).setUp()
@ -614,13 +566,8 @@ class TestUserList(TestUser):
**kwargs **kwargs
) )
collist = ['ID', 'Name'] self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, tuple(data))
datalist = ((
identity_fakes.user_id,
identity_fakes.user_name,
), )
self.assertEqual(datalist, tuple(data))
def test_user_list_domain(self): def test_user_list_domain(self):
arglist = [ arglist = [
@ -644,13 +591,8 @@ class TestUserList(TestUser):
**kwargs **kwargs
) )
collist = ['ID', 'Name'] self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, tuple(data))
datalist = ((
identity_fakes.user_id,
identity_fakes.user_name,
), )
self.assertEqual(datalist, tuple(data))
def test_user_list_group(self): def test_user_list_group(self):
arglist = [ arglist = [
@ -674,13 +616,8 @@ class TestUserList(TestUser):
**kwargs **kwargs
) )
collist = ['ID', 'Name'] self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, tuple(data))
datalist = ((
identity_fakes.user_id,
identity_fakes.user_name,
), )
self.assertEqual(datalist, tuple(data))
def test_user_list_long(self): def test_user_list_long(self):
arglist = [ arglist = [
@ -714,15 +651,17 @@ class TestUserList(TestUser):
'Enabled', 'Enabled',
] ]
self.assertEqual(collist, columns) self.assertEqual(collist, columns)
datalist = (( datalist = (
identity_fakes.user_id, (
identity_fakes.user_name, identity_fakes.user_id,
identity_fakes.project_id, identity_fakes.user_name,
identity_fakes.domain_id, identity_fakes.project_id,
'', identity_fakes.domain_id,
identity_fakes.user_email, '',
True, identity_fakes.user_email,
), ) True,
),
)
self.assertEqual(datalist, tuple(data)) self.assertEqual(datalist, tuple(data))
def test_user_list_project(self): def test_user_list_project(self):
@ -744,13 +683,8 @@ class TestUserList(TestUser):
self.role_assignments_mock.list.assert_called_with(**kwargs) self.role_assignments_mock.list.assert_called_with(**kwargs)
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'] self.assertEqual(self.columns, columns)
self.assertEqual(collist, columns) self.assertEqual(self.datalist, tuple(data))
datalist = ((
identity_fakes.user_id,
identity_fakes.user_name,
), )
self.assertEqual(datalist, tuple(data))
class TestUserSet(TestUser): class TestUserSet(TestUser):