def test_delete_slice(self):

        num_slices = random.randint(1, 5)
        for i in range(num_slices):
            self.test_create_slice(id=i)
        
        # delete some slices and make sure they are gone
        ids = range(1, num_slices)
        random.shuffle(ids)
        for i in ids:
            err = wrap_xmlrpc_call(
                self.om_client.delete_slice, [i], {}, TIMEOUT)
            self.assertEqual(err, "")
            num_slices -= 1
            for fv in DummyFV.objects.all():
                num_actual_slices = DummyFVSlice.objects.filter(fv=fv).count()
                self.assertTrue(
                    num_actual_slices == num_slices,
                    "Expected %s slices after delete but found %s" % (
                        num_slices, num_actual_slices))
            # Check internal OM database:
            count = Experiment.objects.all().count()
            self.assertEqual(
                count,num_slices,
                "There are more slices in OM than expected")
            count = Experiment.objects.filter(slice_id=i).count()
            self.assertEqual(count, 0, "Slice in OM has not deleted!")
            count = ExperimentFLowSpace.objects.filter(
                exp__slice_id = i).count() 
            self.assertEqual(
                count, 0,
                "FlowSpace associated with experiment slice_id" +\
                "=%d has not deleted completely" % i)
Samples from self.dbm using `layer_to_state` as starting values.
dataset/ETHPy150Open fp7-ofelia/ocf/optin_manager/src/python/openflow/optin_manager/xmlrpc_server/tests.py/Tests.test_delete_slice--crossover with--dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/models/dbm/sampling_procedure.py/SamplingProcedure.sample