Merge "[Identity] Check return value is None in identity v3 unit tests"
This commit is contained in:
commit
040d0c2e82
@ -132,11 +132,12 @@ class TestEndpointDelete(TestEndpoint):
|
||||
]
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
self.cmd.take_action(parsed_args)
|
||||
result = self.cmd.take_action(parsed_args)
|
||||
|
||||
self.endpoints_mock.delete.assert_called_with(
|
||||
identity_fakes.endpoint_id,
|
||||
)
|
||||
self.assertIsNone(result)
|
||||
|
||||
|
||||
class TestEndpointList(TestEndpoint):
|
||||
|
@ -613,10 +613,9 @@ class TestProjectUnset(TestProject):
|
||||
verifylist = [
|
||||
('property', ['fee', 'fo']),
|
||||
]
|
||||
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
self.cmd.take_action(parsed_args)
|
||||
result = self.cmd.take_action(parsed_args)
|
||||
# Set expected values
|
||||
kwargs = {
|
||||
'description': identity_fakes.project_description,
|
||||
@ -631,3 +630,4 @@ class TestProjectUnset(TestProject):
|
||||
identity_fakes.project_id,
|
||||
**kwargs
|
||||
)
|
||||
self.assertIsNone(result)
|
||||
|
@ -240,11 +240,12 @@ class TestRoleDelete(TestRole):
|
||||
]
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
self.cmd.take_action(parsed_args)
|
||||
result = self.cmd.take_action(parsed_args)
|
||||
|
||||
self.roles_mock.delete.assert_called_with(
|
||||
identity_fakes.role_id,
|
||||
)
|
||||
self.assertIsNone(result)
|
||||
|
||||
|
||||
class TestRoleList(TestRole):
|
||||
@ -459,7 +460,7 @@ class TestRoleRemove(TestRole):
|
||||
]
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
self.cmd.take_action(parsed_args)
|
||||
result = self.cmd.take_action(parsed_args)
|
||||
|
||||
# RoleManager.remove_user_role(user, role, tenant=None)
|
||||
self.roles_mock.remove_user_role.assert_called_with(
|
||||
@ -467,6 +468,7 @@ class TestRoleRemove(TestRole):
|
||||
identity_fakes.role_id,
|
||||
identity_fakes.project_id,
|
||||
)
|
||||
self.assertIsNone(result)
|
||||
|
||||
|
||||
class TestRoleShow(TestRole):
|
||||
|
@ -194,11 +194,12 @@ class TestServiceDelete(TestService):
|
||||
]
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
self.cmd.take_action(parsed_args)
|
||||
result = self.cmd.take_action(parsed_args)
|
||||
|
||||
self.services_mock.delete.assert_called_with(
|
||||
identity_fakes.service_id,
|
||||
)
|
||||
self.assertIsNone(result)
|
||||
|
||||
|
||||
class TestServiceList(TestService):
|
||||
|
@ -99,6 +99,7 @@ class TestTokenRevoke(TestToken):
|
||||
verifylist = [('token', self.TOKEN)]
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
self.cmd.take_action(parsed_args)
|
||||
result = self.cmd.take_action(parsed_args)
|
||||
|
||||
self.tokens_mock.delete.assert_called_with(self.TOKEN)
|
||||
self.assertIsNone(result)
|
||||
|
@ -414,11 +414,12 @@ class TestUserDelete(TestUser):
|
||||
]
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
self.cmd.take_action(parsed_args)
|
||||
result = self.cmd.take_action(parsed_args)
|
||||
|
||||
self.users_mock.delete.assert_called_with(
|
||||
identity_fakes.user_id,
|
||||
)
|
||||
self.assertIsNone(result)
|
||||
|
||||
|
||||
class TestUserList(TestUser):
|
||||
@ -578,7 +579,7 @@ class TestUserSet(TestUser):
|
||||
]
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
self.cmd.take_action(parsed_args)
|
||||
result = self.cmd.take_action(parsed_args)
|
||||
|
||||
# Set expected values
|
||||
kwargs = {
|
||||
@ -590,6 +591,7 @@ class TestUserSet(TestUser):
|
||||
identity_fakes.user_id,
|
||||
**kwargs
|
||||
)
|
||||
self.assertIsNone(result)
|
||||
|
||||
def test_user_set_password(self):
|
||||
arglist = [
|
||||
@ -608,13 +610,14 @@ class TestUserSet(TestUser):
|
||||
]
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
self.cmd.take_action(parsed_args)
|
||||
result = self.cmd.take_action(parsed_args)
|
||||
|
||||
# UserManager.update_password(user, password)
|
||||
self.users_mock.update_password.assert_called_with(
|
||||
identity_fakes.user_id,
|
||||
'secret',
|
||||
)
|
||||
self.assertIsNone(result)
|
||||
|
||||
def test_user_set_password_prompt(self):
|
||||
arglist = [
|
||||
@ -636,13 +639,14 @@ class TestUserSet(TestUser):
|
||||
mocker = mock.Mock()
|
||||
mocker.return_value = 'abc123'
|
||||
with mock.patch("openstackclient.common.utils.get_password", mocker):
|
||||
self.cmd.take_action(parsed_args)
|
||||
result = self.cmd.take_action(parsed_args)
|
||||
|
||||
# UserManager.update_password(user, password)
|
||||
self.users_mock.update_password.assert_called_with(
|
||||
identity_fakes.user_id,
|
||||
'abc123',
|
||||
)
|
||||
self.assertIsNone(result)
|
||||
|
||||
def test_user_set_email(self):
|
||||
arglist = [
|
||||
@ -660,7 +664,7 @@ class TestUserSet(TestUser):
|
||||
]
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
self.cmd.take_action(parsed_args)
|
||||
result = self.cmd.take_action(parsed_args)
|
||||
|
||||
# Set expected values
|
||||
kwargs = {
|
||||
@ -672,6 +676,7 @@ class TestUserSet(TestUser):
|
||||
identity_fakes.user_id,
|
||||
**kwargs
|
||||
)
|
||||
self.assertIsNone(result)
|
||||
|
||||
def test_user_set_project(self):
|
||||
arglist = [
|
||||
@ -689,13 +694,14 @@ class TestUserSet(TestUser):
|
||||
]
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
self.cmd.take_action(parsed_args)
|
||||
result = self.cmd.take_action(parsed_args)
|
||||
|
||||
# UserManager.update_tenant(user, tenant)
|
||||
self.users_mock.update_tenant.assert_called_with(
|
||||
identity_fakes.user_id,
|
||||
identity_fakes.project_id,
|
||||
)
|
||||
self.assertIsNone(result)
|
||||
|
||||
def test_user_set_enable(self):
|
||||
arglist = [
|
||||
@ -713,7 +719,7 @@ class TestUserSet(TestUser):
|
||||
]
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
self.cmd.take_action(parsed_args)
|
||||
result = self.cmd.take_action(parsed_args)
|
||||
|
||||
# Set expected values
|
||||
kwargs = {
|
||||
@ -724,6 +730,7 @@ class TestUserSet(TestUser):
|
||||
identity_fakes.user_id,
|
||||
**kwargs
|
||||
)
|
||||
self.assertIsNone(result)
|
||||
|
||||
def test_user_set_disable(self):
|
||||
arglist = [
|
||||
@ -741,7 +748,7 @@ class TestUserSet(TestUser):
|
||||
]
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
||||
self.cmd.take_action(parsed_args)
|
||||
result = self.cmd.take_action(parsed_args)
|
||||
|
||||
# Set expected values
|
||||
kwargs = {
|
||||
@ -752,6 +759,7 @@ class TestUserSet(TestUser):
|
||||
identity_fakes.user_id,
|
||||
**kwargs
|
||||
)
|
||||
self.assertIsNone(result)
|
||||
|
||||
|
||||
class TestUserShow(TestUser):
|
||||
|
Loading…
Reference in New Issue
Block a user