'Test the soft deletion of a cgsnapshot'

@ddt.data(True, False)
def test_soft_delete_cgsnapshot(self, bitset_exists):

    cg = copy.deepcopy(eseries_fake.FAKE_CONSISTENCY_GROUP)
    cg_snap = copy.deepcopy(eseries_fake.SNAPSHOT_IMAGE)
    seq_num = 10
    cg_snap['pitSequenceNumber'] = seq_num
    cg_snaps = [cg_snap]
    self.mock_object(self.library._client, 'delete_consistency_group_snapshot')
    self.mock_object(self.library._client, 'get_consistency_group_snapshots', return_value=cg_snaps)
    bitset = na_utils.BitSet(1)
    index = ({cg['id']: repr(bitset)} if bitset_exists else {})
    bitset >>= len(cg_snaps)
    updt = {cg['id']: repr(bitset)}
    self.mock_object(self.library, '_get_soft_delete_map', return_value=index)
    save_map = self.mock_object(self.library, '_merge_soft_delete_changes')
    (model_update, snap_updt) = self.library._soft_delete_cgsnapshot(cg, seq_num)
    self.assertIsNone(model_update)
    self.assertIsNone(snap_updt)
    save_map.assert_called_once_with(updt, None)
