def test_get_random_access(self):
        # First add an image...
        image_id = str(uuid.uuid4())
        file_contents = b"chunk00000remainder"
        image_file = six.BytesIO(file_contents)

        loc, size, checksum, _ = self.store.add(image_id,
                                                image_file,
                                                len(file_contents))

        # Now read it back...
        uri = "file:///%s/%s" % (self.test_dir, image_id)
        loc = location.get_location_from_uri(uri, conf=self.conf)

        data = b""
        for offset in range(len(file_contents)):
            (image_file, image_size) = self.store.get(loc,
                                                      offset=offset,
                                                      chunk_size=1)
            for chunk in image_file:
                data += chunk

        self.assertEqual(data, file_contents)

        data = b""
        chunk_size = 5
        (image_file, image_size) = self.store.get(loc,
                                                  offset=chunk_size,
                                                  chunk_size=chunk_size)
        for chunk in image_file:
            data += chunk

        self.assertEqual(data, b'00000')
        self.assertEqual(image_size, chunk_size)
Delete an object
dataset/ETHPy150Open openstack/glance_store/glance_store/tests/unit/test_filesystem_store.py/TestStore.test_get_random_access--crossover with--dataset/ETHPy150Open MirantisWorkloadMobility/CloudFerry/cloudferry_devlab/cloudferry_devlab/tests/base.py/BasePrerequisites.delete_swift_object