'Test Create volume with consistency_group'

@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type', mock.MagicMock(return_value=True))
def test_create_volume_with_consistency_group(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._cg_name_from_volume = mock.MagicMock(return_value='cg')
    vol_type = testutils.create_volume_type(self.ctxt, name='WTF')
    volume = testutils.create_volume(self.ctxt, size=16, volume_type_id=vol_type.id)
    grp = self._create_test_group('WTF')
    volume.group = grp
    p.create_volume(volume)
    p.ibm_storage_cli.cmd.vol_create.assert_called_once_with(vol=volume['name'], size_blocks=storage.gigabytes_to_blocks(16), pool='WTF32')
    p.ibm_storage_cli.cmd.cg_add_vol.assert_called_once_with(vol=volume['name'], cg='cg')
