Beispiel #1
0
def test_png_img_writer():
    base_dir = get_temp_path(prefix="test_png_img_writer")
    manager = CacheManager(base_dir)

    tagged_data = ImageMockTaggedData(relative_path="img.png")

    assert manager.get(tagged_data.tag) is None

    ds_object = DataSetObject(tagged_data)
    ds_object.add_cache_manager(manager)
    object_bytes = ds_object.get()  # This load the object into the cache
    assert manager.get(ds_object.tag) == object_bytes
Beispiel #2
0
    def transform_single_object(
            self, dataset_object: DataSetObject) -> List[DataSetObject]:
        dataset_object.add_cache_manager(self.cache_manager)

        return [dataset_object]