MCPcopy Create free account
hub / github.com/917Dhj/DeepPaperNote / write_test_pdf

Function write_test_pdf

tests/test_extract_source_text.py:20–30  ·  view source on GitHub ↗
(path: Path, pages: list[str])

Source from the content-addressed store, hash-verified

18
19
20def write_test_pdf(path: Path, pages: list[str]) -> None:
21 if fitz is None:
22 pytest.skip("PyMuPDF is required for PDF source extraction tests.")
23 doc = fitz.open()
24 try:
25 for text in pages:
26 page = doc.new_page()
27 page.insert_text((72, 72), text)
28 doc.save(path)
29 finally:
30 doc.close()
31
32
33def run_extract_source(input_path: Path, output_path: Path, *extra: str) -> dict:

Calls 2

openMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected