Add test for role list --inherited

Change-Id: I216ab6c8ac903720ec67870a5171ae57a8f293aa
This commit is contained in:
Dean Troyer 2015-10-07 17:37:20 -05:00
parent 7075c90053
commit e523c699a2

View File

@ -367,6 +367,39 @@ class TestRoleList(TestRole):
), )
self.assertEqual(datalist, tuple(data))
def test_user_list_inherited(self):
arglist = [
'--user', identity_fakes.user_id,
'--inherited',
]
verifylist = [
('user', identity_fakes.user_id),
('inherited', True),
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
# DisplayCommandBase.take_action() returns two tuples
columns, data = self.cmd.take_action(parsed_args)
# Set expected values
kwargs = {
'domain': 'default',
'user': self.users_mock.get(),
'os_inherit_extension_inherited': True,
}
# RoleManager.list(user=, group=, domain=, project=, **kwargs)
self.roles_mock.list.assert_called_with(
**kwargs
)
collist = ('ID', 'Name')
self.assertEqual(collist, columns)
datalist = ((
identity_fakes.role_id,
identity_fakes.role_name,
), )
self.assertEqual(datalist, tuple(data))
def test_user_list_user(self):
arglist = [
'--user', identity_fakes.user_id,