def test_dataset_delete_samples(self):
        """Tests that when a sample is deleted from a dataset, the sample is
        disconnected from the dataset.
        """
        dataset = fo.Dataset()

        # add 1 sample
        sample = fo.Sample(filepath="test1.png")
        dataset.add_sample(sample)
        self.assertTrue(sample.in_dataset)
        self.assertIsNotNone(sample.id)
        self.assertIs(sample.dataset, dataset)

        # delete 1 sample
        dataset.delete_samples(sample)
        self.assertFalse(sample.in_dataset)
        self.assertIsNone(sample.id)
        self.assertIsNone(sample.dataset)

        # add multiple samples
        filepath_template = "test%d.png"
        num_samples = 10
        samples = [
            fo.Sample(filepath=filepath_template % i)
            for i in range(num_samples)
        ]
        dataset.add_samples(samples)
        for sample in samples:
            self.assertTrue(sample.in_dataset)
            self.assertIsNotNone(sample.id)
            self.assertIs(sample.dataset, dataset)

        # delete some
        num_delete = 7
        dataset.delete_samples([sample.id for sample in samples[:num_delete]])
        for i, sample in enumerate(samples):
            if i < num_delete:
                self.assertFalse(sample.in_dataset)
                self.assertIsNone(sample.id)
                self.assertIsNone(sample.dataset)
            else:
                self.assertTrue(sample.in_dataset)
                self.assertIsNotNone(sample.id)
                self.assertIs(sample.dataset, dataset)

        # clear dataset
        dataset.clear()
        for sample in samples:
            self.assertFalse(sample.in_dataset)
            self.assertIsNone(sample.id)
            self.assertIsNone(sample.dataset)
Tests that when a sample is deleted from a dataset, the sample is
        disconnected from the dataset.
        
tests/unittests/synchronization_tests.py