Add ut for show not exist device_profile client api

Change-Id: I49892997d26185e80a27ec2b029575e3c207624c
This commit is contained in:
leiyuehui 2023-06-09 10:15:37 +08:00
parent da3392d687
commit e31150d377
1 changed files with 11 additions and 0 deletions

View File

@ -137,6 +137,17 @@ class TestDeviceProfileShow(TestDeviceProfile):
formatters=formatters)
self.assertEqual(result, (columns, expected))
def test_device_profile_show_not_exist(self):
get_arq_req = self.mock_acc_client.get_device_profile
get_arq_req.side_effect = sdk_exc.ResourceNotFound
arglist = [acc_fakes.device_profile_name]
verifylist = []
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
self.assertRaisesRegex(
exc.CommandError,
'device_profile %s not found' % acc_fakes.device_profile_name,
self.cmd.take_action, parsed_args)
class TestDeviceProfileCreate(TestDeviceProfile):