'Test creating cloned volume with different exist group counts.'

@ddt.data(0, 1, 3)
def test_create_cloned_volume(self, snapshot_group_count):

    fake_eseries_volume = copy.deepcopy(eseries_fake.VOLUME)
    self.library._get_volume = mock.Mock(return_value=fake_eseries_volume)
    fake_pool = copy.deepcopy(eseries_fake.STORAGE_POOL)
    self.library._get_storage_pools = mock.Mock(return_value=[fake_pool])
    fake_snapshot_group_list = eseries_fake.list_snapshot_groups(snapshot_group_count)
    self.library._client.list_snapshot_groups = mock.Mock(return_value=fake_snapshot_group_list)
    fake_snapshot_group = copy.deepcopy(eseries_fake.SNAPSHOT_GROUP)
    self.library._client.create_snapshot_group = mock.Mock(return_value=fake_snapshot_group)
    fake_snapshot_image = copy.deepcopy(eseries_fake.SNAPSHOT_IMAGE)
    self.library._client.create_snapshot_image = mock.Mock(return_value=fake_snapshot_image)
    self.library._get_snapshot_group_for_snapshot = mock.Mock(return_value=copy.deepcopy(eseries_fake.SNAPSHOT_GROUP))
    fake_created_volume = copy.deepcopy(eseries_fake.VOLUMES[1])
    self.library.create_volume_from_snapshot = mock.Mock(return_value=fake_created_volume)
    fake_cinder_volume = copy.deepcopy(eseries_fake.FAKE_CINDER_VOLUME)
    extend_vol = {'id': uuid.uuid4(), 'size': 10}
    self.mock_object(self.library, '_create_volume_from_snapshot')
    self.library.create_cloned_volume(extend_vol, fake_cinder_volume)
