MCPcopy Create free account
hub / github.com/docling-project/docling-parse / test_render_from_bytesio

Function test_render_from_bytesio

tests/test_threaded_render.py:189–206  ·  view source on GitHub ↗

Render a document loaded from a BytesIO object.

()

Source from the content-addressed store, hash-verified

187
188
189def test_render_from_bytesio():
190 """Render a document loaded from a BytesIO object."""
191 filename = SAMPLE_PDF
192
193 with open(filename, "rb") as f:
194 data = BytesIO(f.read())
195
196 parser = _make_parser()
197 key = parser.load(data)
198
199 count = 0
200 for result in parser.iterate_results():
201 assert result.doc_key == key
202 assert result.success, result.error_message
203 assert result.get_image().mode == "RGBA"
204 count += 1
205
206 assert count == parser.page_count(key)
207
208
209def test_render_backpressure():

Callers

nothing calls this directly

Calls 5

iterate_resultsMethod · 0.80
get_imageMethod · 0.80
page_countMethod · 0.80
_make_parserFunction · 0.70
loadMethod · 0.45

Tested by

no test coverage detected