def test__get_next_boot_list_onetime(self, mock_client_pywsman): result_xml = test_utils.build_soap_xml([{ 'DCIM_BootConfigSetting': { 'InstanceID': 'IPL', 'IsNext': drac_mgmt.PERSISTENT } }, { 'DCIM_BootConfigSetting': { 'InstanceID': 'OneTime', 'IsNext': drac_mgmt.ONE_TIME_BOOT } }], resource_uris.DCIM_BootConfigSetting) mock_xml = test_utils.mock_wsman_root(result_xml) mock_pywsman = mock_client_pywsman.Client.return_value mock_pywsman.enumerate.return_value = mock_xml expected = { 'instance_id': 'OneTime', 'is_next': drac_mgmt.ONE_TIME_BOOT } result = drac_mgmt._get_next_boot_list(self.node) self.assertEqual(expected, result) mock_pywsman.enumerate.assert_called_once_with( mock.ANY, mock.ANY, resource_uris.DCIM_BootConfigSetting)
def test__get_next_boot_list(self, mock_client_pywsman): result_xml = test_utils.build_soap_xml( [{'DCIM_BootConfigSetting': {'InstanceID': 'IPL', 'IsNext': drac_mgmt.PERSISTENT}}], resource_uris.DCIM_BootConfigSetting) mock_xml = test_utils.mock_wsman_root(result_xml) mock_pywsman = mock_client_pywsman.Client.return_value mock_pywsman.enumerate.return_value = mock_xml expected = {'instance_id': 'IPL', 'is_next': drac_mgmt.PERSISTENT} result = drac_mgmt._get_next_boot_list(self.node) self.assertEqual(expected, result) mock_pywsman.enumerate.assert_called_once_with( mock.ANY, mock.ANY, resource_uris.DCIM_BootConfigSetting)