Coverage for src / quber / core / parsers / mock.py: 100%

10 statements  

« prev     ^ index     » next       coverage.py v7.14.0, created at 2026-09-23 22:14 -0400

1""" 

2MockParser — returns a ParseResult wrapping an empty DoclingDocument. For tests 

3that exercise the Parser seam without hitting the docling pipeline. 

4""" 

5 

6from pathlib import Path 

7 

8from docling_core.types.doc.document import DoclingDocument 

9 

10from quber.core.parsers.base import Parser 

11from quber.core.parsers.result import ParseResult 

12 

13 

14class MockParser(Parser): 

15 def __init__(self, result: ParseResult | None = None) -> None: 

16 self._result = result or ParseResult(document=DoclingDocument(name="mock")) 

17 

18 def parse(self, source: Path) -> ParseResult: 

19 _ = source 

20 return self._result