def test_to_pdf() -> None:
manager = PreviewManager(cache_folder_path=CACHE_DIR, create_folder=True)
> assert manager.has_pdf_preview(file_path=IMAGE_FILE_PATH) is True
E AssertionError: assert False is True
E + where False = <bound method PreviewManager.has_pdf_preview of <preview_generator.manager.PreviewManager object at 0x7fe1a3c74050>>(file_path='/home/mdk/clones/preview-generator/tests/input/pdf/the_pdf.pdf')
E + where <bound method PreviewManager.has_pdf_preview of <preview_generator.manager.PreviewManager object at 0x7fe1a3c74050>> = <preview_generator.manager.PreviewManager object at 0x7fe1a3c74050>.has_pdf_preview
This one looks tricky.
From what I understand, keeping a single backend per input mimetype as we're doing in builder_factory's load_builders is not enough, we should either keep a set of backends or keep a single backend per (input_mimetype, output_mimetype).
This could open a whole new world of using backends:
For example if we have a backend capable of doing odt to pdf, another capable of doing pdf to jpg, we can convert odt to jpg by chaining both of them. Currently it looks like we're doing so by hardcoding those "paths" in builders, but we could resolve the path in the manager instead.
Related to #113 (read first).
I'm getting:
This one looks tricky.
From what I understand, keeping a single backend per input mimetype as we're doing in
builder_factory
'sload_builders
is not enough, we should either keep a set of backends or keep a single backend per(input_mimetype, output_mimetype)
.This could open a whole new world of using backends:
For example if we have a backend capable of doing odt to pdf, another capable of doing pdf to jpg, we can convert odt to jpg by chaining both of them. Currently it looks like we're doing so by hardcoding those "paths" in builders, but we could resolve the path in the manager instead.