Redfish: Adds test case for 'get_supported_boot_mode'

This commit adds failure test case for the redfish method
'get_supported_boot_mode'

Change-Id: Iae01446ba2eda7f6556cbde22103be81fc777634
This commit is contained in:
Aparna 2017-07-27 06:42:07 +00:00
parent 8e8d261d9b
commit a847cae5f3
1 changed files with 11 additions and 0 deletions

View File

@ -667,6 +667,17 @@ class RedfishOperationsTestCase(testtools.TestCase):
actual_val = self.rf_client.get_supported_boot_mode()
self.assertEqual(expected_boot_val, actual_val)
@mock.patch.object(redfish.RedfishOperations, '_get_sushy_system')
def test_get_supported_boot_mode_error(self, get_system_mock):
supported_boot_mode_mock = mock.PropertyMock(
side_effect=sushy.exceptions.SushyError)
type(get_system_mock.return_value).supported_boot_mode = (
supported_boot_mode_mock)
self.assertRaisesRegex(
exception.IloError,
'The Redfish controller failed to get the supported boot modes.',
self.rf_client.get_supported_boot_mode)
@mock.patch.object(redfish.RedfishOperations, '_get_sushy_system')
@mock.patch.object(redfish.RedfishOperations, '_get_sushy_manager')
def test_get_server_capabilities(self, get_manager_mock, get_system_mock):