'Test performance class creation with type'

@mock.patch('cinder.volume.drivers.ibm.ibm_storage.xiv_proxy.XIVProxy._qos_create_kwargs_for_xcli', mock.MagicMock(return_value={}))
def test_create_qos_class_with_type(self):

    driver = mock.MagicMock()
    driver.VERSION = 'VERSION'
    p = self.proxy(self.default_storage_info, mock.MagicMock(), test_mock.cinder.exception, driver)
    p.ibm_storage_cli = mock.MagicMock()
    p.ibm_storage_cli.cmd.perf_class_set_rate.return_value = None
    p.ibm_storage_cli.cmd.perf_class_create.return_value = None
    perf_class_name = 'cinder-qos_iops_1000_type_independent_bw_1000'
    p_class_name = p._create_qos_class(perf_class_name=perf_class_name, specs=None)
    p.ibm_storage_cli.cmd.perf_class_create.assert_called_once_with(perf_class=perf_class_name, type='independent')
    self.assertEqual('cinder-qos_iops_1000_type_independent_bw_1000', p_class_name)
