'resize_image common case usage.'

@ddt.data(NFS_CONFIG1, NFS_CONFIG2, NFS_CONFIG3, NFS_CONFIG4)
def test_copy_image_to_volume(self, nfs_config):

    mock_resize = self.mock_object(image_utils, 'resize_image')
    mock_fetch = self.mock_object(image_utils, 'fetch_to_raw')
    self._set_driver()
    drv = self._driver
    volume = fake_volume.fake_volume_obj(self.context, size=self.TEST_SIZE_IN_GB)
    test_img_source = ('volume-%s' % volume.id)
    self.mock_object(drv, 'local_path', return_value=test_img_source)
    data = mock.Mock()
    data.virtual_size = (1 * units.Gi)
    self.mock_object(image_utils, 'qemu_img_info', return_value=data)
    drv.copy_image_to_volume(None, volume, None, None)
    mock_fetch.assert_called_once_with(None, None, None, test_img_source, mock.ANY, run_as_root=True, size=self.TEST_SIZE_IN_GB)
    mock_resize.assert_called_once_with(test_img_source, self.TEST_SIZE_IN_GB, run_as_root=True)
