add ut for delete attribute client exception error

add ut for delete attribute client exception error

Change-Id: I9a1c3304df15fa4815a30b1b980566134788eb3c
This commit is contained in:
wangzhiguang 2023-09-11 11:13:09 +08:00
parent 51c06d55f1
commit 0b8f60cb02
1 changed files with 10 additions and 0 deletions

View File

@ -216,3 +216,13 @@ class TestAttributeDelete(TestAttribute):
exc.CommandError,
'Attribute %s not found' % acc_fakes.attribute_uuid,
self.cmd.take_action, parsed_args)
def test_attribute_delete_for_client_exception(self):
get_arq_req = self.mock_acc_client.delete_attribute
get_arq_req.side_effect = exc.ClientException
arglist = [acc_fakes.attribute_uuid]
verifylist = []
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
self.assertRaises(
exc.ClientException,
self.cmd.take_action, parsed_args)