'Test the backend deletion of the oldest cgsnapshot'

def test_delete_cgsnapshot_single(self):

    fake_cgsnapshot = copy.deepcopy(eseries_fake.FAKE_CINDER_CG_SNAPSHOT)
    fake_vol = cinder_utils.create_volume(self.ctxt)
    fake_snapshots = [cinder_utils.create_snapshot(self.ctxt, fake_vol['id'])]
    cg_snap = copy.deepcopy(eseries_fake.SNAPSHOT_IMAGE)
    cg_snaps = [cg_snap]
    for snap in fake_snapshots:
        snap['provider_id'] = cg_snap['id']
    cg = copy.deepcopy(eseries_fake.FAKE_CONSISTENCY_GROUP)
    cg['uniqueSequenceNumber'] = [cg_snap['pitSequenceNumber']]
    vol = copy.deepcopy(eseries_fake.VOLUME)
    for snap in cg_snaps:
        snap['baseVol'] = vol['id']
    get_cg = self.mock_object(self.library, '_get_consistencygroup_by_name', return_value=cg)
    del_snap = self.mock_object(self.library._client, 'delete_consistency_group_snapshot', return_value=cg_snaps)
    (model_update, snap_updt) = self.library.delete_cgsnapshot(fake_cgsnapshot, fake_snapshots)
    self.assertIsNone(model_update)
    self.assertIsNone(snap_updt)
    get_cg.assert_called_once_with(utils.convert_uuid_to_es_fmt(fake_cgsnapshot['consistencygroup_id']))
    del_snap.assert_called_once_with(cg['id'], cg_snap['pitSequenceNumber'])
