Strengthen weak assertions in context enhancement and converter tests
- Add doc_item_refs and headings assertions to test_expand_context_docling_merges_metadata - Add page count and markdown content assertions to test_convert_pdf_with_ocr_engine Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
3c7d746d57
commit
c7b03eb9ab
3 changed files with 10 additions and 0 deletions
|
|
@ -1,6 +1,10 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- **Test suite cleanup**: Removed stale VCR cassettes, dead fixtures, orphaned directories, and redundant tests. Strengthened weak assertions across search, context enhancement, and converter tests. Relocated misplaced `SearchResult._get_primary_label` test to `test_search.py`
|
||||||
|
|
||||||
## [0.33.0] - 2026-03-04
|
## [0.33.0] - 2026-03-04
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
||||||
|
|
@ -642,6 +642,10 @@ First paragraph of results.
|
||||||
assert len(r.content) > 0
|
assert len(r.content) > 0
|
||||||
# Score should be preserved (best score)
|
# Score should be preserved (best score)
|
||||||
assert r.score in [0.9, 0.8]
|
assert r.score in [0.9, 0.8]
|
||||||
|
# Expanded content should have docling refs
|
||||||
|
assert r.doc_item_refs is not None and len(r.doc_item_refs) > 0
|
||||||
|
# Document has headings, expanded result should too
|
||||||
|
assert r.headings is not None and len(r.headings) > 0
|
||||||
|
|
||||||
|
|
||||||
def create_picture_document() -> DoclingDocument:
|
def create_picture_document() -> DoclingDocument:
|
||||||
|
|
|
||||||
|
|
@ -1067,6 +1067,8 @@ class TestDoclingServeConverterIntegration:
|
||||||
|
|
||||||
doc = await converter.convert_file(pdf_path)
|
doc = await converter.convert_file(pdf_path)
|
||||||
assert isinstance(doc, DoclingDocument)
|
assert isinstance(doc, DoclingDocument)
|
||||||
|
assert len(doc.pages) > 0
|
||||||
|
assert len(doc.export_to_markdown().strip()) > 100
|
||||||
|
|
||||||
@pytest.mark.xfail(
|
@pytest.mark.xfail(
|
||||||
reason="docling-serve does not return picture image data in JSON response "
|
reason="docling-serve does not return picture image data in JSON response "
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue