diff --git a/openstackclient/tests/identity/v3/test_credential.py b/openstackclient/tests/identity/v3/test_credential.py index afff7b6c09..d8866124f9 100644 --- a/openstackclient/tests/identity/v3/test_credential.py +++ b/openstackclient/tests/identity/v3/test_credential.py @@ -96,9 +96,11 @@ class TestCredentialSet(TestCredential): '--data', self.json_data, identity_fakes.credential_id, ] - parsed_args = self.check_parser(self.cmd, arglist, []) - self.cmd.take_action(parsed_args) + + result = self.cmd.take_action(parsed_args) + + self.assertIsNone(result) def test_credential_set_valid_with_project(self): arglist = [ @@ -108,6 +110,8 @@ class TestCredentialSet(TestCredential): '--project', identity_fakes.project_name, identity_fakes.credential_id, ] - parsed_args = self.check_parser(self.cmd, arglist, []) - self.cmd.take_action(parsed_args) + + result = self.cmd.take_action(parsed_args) + + self.assertIsNone(result) diff --git a/openstackclient/tests/identity/v3/test_identity_provider.py b/openstackclient/tests/identity/v3/test_identity_provider.py index ddad6ffb88..1ee7aade27 100644 --- a/openstackclient/tests/identity/v3/test_identity_provider.py +++ b/openstackclient/tests/identity/v3/test_identity_provider.py @@ -258,10 +258,13 @@ class TestIdentityProviderDelete(TestIdentityProvider): ('identity_provider', identity_fakes.idp_id), ] parsed_args = self.check_parser(self.cmd, arglist, verifylist) - self.cmd.take_action(parsed_args) + + result = self.cmd.take_action(parsed_args) + self.identity_providers_mock.delete.assert_called_with( identity_fakes.idp_id, ) + self.assertIsNone(result) class TestIdentityProviderList(TestIdentityProvider): diff --git a/openstackclient/tests/identity/v3/test_mappings.py b/openstackclient/tests/identity/v3/test_mappings.py index e811c0b644..106a419c49 100644 --- a/openstackclient/tests/identity/v3/test_mappings.py +++ b/openstackclient/tests/identity/v3/test_mappings.py @@ -92,11 +92,13 @@ class TestMappingDelete(TestMapping): verifylist = [ ('mapping', identity_fakes.mapping_id) ] - parsed_args = self.check_parser(self.cmd, arglist, verifylist) - self.cmd.take_action(parsed_args) + + result = self.cmd.take_action(parsed_args) + self.mapping_mock.delete.assert_called_with( identity_fakes.mapping_id) + self.assertIsNone(result) class TestMappingList(TestMapping): @@ -234,7 +236,6 @@ class TestMappingSet(TestMapping): ('mapping', identity_fakes.mapping_id), ('rules', identity_fakes.mapping_rules_file_path) ] - parsed_args = self.check_parser(self.cmd, arglist, verifylist) self.assertRaises( diff --git a/openstackclient/tests/identity/v3/test_protocol.py b/openstackclient/tests/identity/v3/test_protocol.py index 3c9c3f0a7d..238b0ff8f1 100644 --- a/openstackclient/tests/identity/v3/test_protocol.py +++ b/openstackclient/tests/identity/v3/test_protocol.py @@ -92,9 +92,12 @@ class TestProtocolDelete(TestProtocol): ('identity_provider', identity_fakes.idp_id), ] parsed_args = self.check_parser(self.cmd, arglist, verifylist) - self.cmd.take_action(parsed_args) + + result = self.cmd.take_action(parsed_args) + self.protocols_mock.delete.assert_called_with( identity_fakes.idp_id, identity_fakes.protocol_id) + self.assertIsNone(result) class TestProtocolList(TestProtocol): diff --git a/openstackclient/tests/identity/v3/test_role.py b/openstackclient/tests/identity/v3/test_role.py index 19410debe4..d2398e5d91 100644 --- a/openstackclient/tests/identity/v3/test_role.py +++ b/openstackclient/tests/identity/v3/test_role.py @@ -306,11 +306,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): @@ -640,7 +641,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) # Set expected values kwargs = { @@ -653,6 +654,7 @@ class TestRoleRemove(TestRole): identity_fakes.role_id, **kwargs ) + self.assertIsNone(result) def test_role_remove_user_project(self): arglist = [ @@ -672,7 +674,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) # Set expected values kwargs = { @@ -685,6 +687,7 @@ class TestRoleRemove(TestRole): identity_fakes.role_id, **kwargs ) + self.assertIsNone(result) def test_role_remove_group_domain(self): arglist = [ @@ -705,7 +708,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) # Set expected values kwargs = { @@ -718,6 +721,7 @@ class TestRoleRemove(TestRole): identity_fakes.role_id, **kwargs ) + self.assertIsNone(result) def test_role_remove_group_project(self): arglist = [ @@ -737,7 +741,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) # Set expected values kwargs = { @@ -750,6 +754,7 @@ class TestRoleRemove(TestRole): identity_fakes.role_id, **kwargs ) + self.assertIsNone(result) class TestRoleSet(TestRole): @@ -778,7 +783,7 @@ class TestRoleSet(TestRole): ] 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 = { @@ -789,6 +794,7 @@ class TestRoleSet(TestRole): identity_fakes.role_id, **kwargs ) + self.assertIsNone(result) class TestRoleShow(TestRole): diff --git a/openstackclient/tests/identity/v3/test_service_provider.py b/openstackclient/tests/identity/v3/test_service_provider.py index 39f779d0f7..b1285b1080 100644 --- a/openstackclient/tests/identity/v3/test_service_provider.py +++ b/openstackclient/tests/identity/v3/test_service_provider.py @@ -188,10 +188,13 @@ class TestServiceProviderDelete(TestServiceProvider): ('service_provider', service_fakes.sp_id), ] parsed_args = self.check_parser(self.cmd, arglist, verifylist) - self.cmd.take_action(parsed_args) + + result = self.cmd.take_action(parsed_args) + self.service_providers_mock.delete.assert_called_with( service_fakes.sp_id, ) + self.assertIsNone(result) class TestServiceProviderList(TestServiceProvider): diff --git a/openstackclient/tests/identity/v3/test_token.py b/openstackclient/tests/identity/v3/test_token.py index 80c397bccf..b68bc242ec 100644 --- a/openstackclient/tests/identity/v3/test_token.py +++ b/openstackclient/tests/identity/v3/test_token.py @@ -123,6 +123,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.revoke_token.assert_called_with(self.TOKEN) + self.assertIsNone(result) diff --git a/openstackclient/tests/identity/v3/test_trust.py b/openstackclient/tests/identity/v3/test_trust.py index 2a74887228..1ea2feb444 100644 --- a/openstackclient/tests/identity/v3/test_trust.py +++ b/openstackclient/tests/identity/v3/test_trust.py @@ -141,11 +141,12 @@ class TestTrustDelete(TestTrust): ] parsed_args = self.check_parser(self.cmd, arglist, verifylist) - self.cmd.take_action(parsed_args) + result = self.cmd.take_action(parsed_args) self.trusts_mock.delete.assert_called_with( identity_fakes.trust_id, ) + self.assertIsNone(result) class TestTrustList(TestTrust): diff --git a/openstackclient/tests/identity/v3/test_user.py b/openstackclient/tests/identity/v3/test_user.py index 571e2d798e..5dafa772ff 100644 --- a/openstackclient/tests/identity/v3/test_user.py +++ b/openstackclient/tests/identity/v3/test_user.py @@ -499,11 +499,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): @@ -774,7 +775,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 = { @@ -787,6 +788,7 @@ class TestUserSet(TestUser): identity_fakes.user_id, **kwargs ) + self.assertIsNone(result) def test_user_set_password(self): arglist = [ @@ -805,7 +807,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 = { @@ -818,6 +820,7 @@ class TestUserSet(TestUser): identity_fakes.user_id, **kwargs ) + self.assertIsNone(result) def test_user_set_password_prompt(self): arglist = [ @@ -839,7 +842,7 @@ 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) # Set expected values kwargs = { @@ -852,6 +855,7 @@ class TestUserSet(TestUser): identity_fakes.user_id, **kwargs ) + self.assertIsNone(result) def test_user_set_email(self): arglist = [ @@ -869,7 +873,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 = { @@ -882,6 +886,7 @@ class TestUserSet(TestUser): identity_fakes.user_id, **kwargs ) + self.assertIsNone(result) def test_user_set_project(self): arglist = [ @@ -899,7 +904,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 = { @@ -912,6 +917,7 @@ class TestUserSet(TestUser): identity_fakes.user_id, **kwargs ) + self.assertIsNone(result) def test_user_set_project_domain(self): arglist = [ @@ -931,7 +937,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 = { @@ -944,6 +950,7 @@ class TestUserSet(TestUser): identity_fakes.user_id, **kwargs ) + self.assertIsNone(result) def test_user_set_enable(self): arglist = [ @@ -961,7 +968,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 = { @@ -973,6 +980,7 @@ class TestUserSet(TestUser): identity_fakes.user_id, **kwargs ) + self.assertIsNone(result) def test_user_set_disable(self): arglist = [ @@ -990,7 +998,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 = { @@ -1002,6 +1010,7 @@ class TestUserSet(TestUser): identity_fakes.user_id, **kwargs ) + self.assertIsNone(result) class TestUserSetPassword(TestUser): @@ -1030,11 +1039,12 @@ class TestUserSetPassword(TestUser): # Mock getting user current password. with self._mock_get_password(current_pass): - self.cmd.take_action(parsed_args) + result = self.cmd.take_action(parsed_args) self.users_mock.update_password.assert_called_with( current_pass, new_pass ) + self.assertIsNone(result) def test_user_create_password_prompt(self): current_pass = 'old_pass' @@ -1043,11 +1053,12 @@ class TestUserSetPassword(TestUser): # Mock getting user current and new password. with self._mock_get_password(current_pass, new_pass): - self.cmd.take_action(parsed_args) + result = self.cmd.take_action(parsed_args) self.users_mock.update_password.assert_called_with( current_pass, new_pass ) + self.assertIsNone(result) def test_user_password_change_no_prompt(self): current_pass = 'old_pass' @@ -1062,11 +1073,12 @@ class TestUserSetPassword(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.update_password.assert_called_with( current_pass, new_pass ) + self.assertIsNone(result) class TestUserShow(TestUser):