fix(tests): use correct bbox_pct dict format in _cells_to_vocab_entries tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-03-02 18:26:24 +01:00
parent 991984d9c3
commit f13116345b

View File

@@ -1306,7 +1306,7 @@ class TestCellsToVocabEntriesPageRef:
'row_index': 0,
'col_type': 'column_en',
'text': 'hello',
'bbox_pct': [10, 10, 30, 5],
'bbox_pct': {'x': 10, 'y': 10, 'w': 30, 'h': 5},
'confidence': 95.0,
'ocr_engine': 'tesseract',
},
@@ -1314,7 +1314,7 @@ class TestCellsToVocabEntriesPageRef:
'row_index': 0,
'col_type': 'column_de',
'text': 'hallo',
'bbox_pct': [40, 10, 30, 5],
'bbox_pct': {'x': 40, 'y': 10, 'w': 30, 'h': 5},
'confidence': 90.0,
'ocr_engine': 'tesseract',
},
@@ -1322,7 +1322,7 @@ class TestCellsToVocabEntriesPageRef:
'row_index': 0,
'col_type': 'page_ref',
'text': 'p.59',
'bbox_pct': [5, 10, 5, 5],
'bbox_pct': {'x': 5, 'y': 10, 'w': 5, 'h': 5},
'confidence': 80.0,
'ocr_engine': 'tesseract',
},
@@ -1337,7 +1337,7 @@ class TestCellsToVocabEntriesPageRef:
assert entries[0]['english'] == 'hello'
assert entries[0]['german'] == 'hallo'
assert entries[0]['source_page'] == 'p.59'
assert entries[0]['bbox_ref'] == [5, 10, 5, 5]
assert entries[0]['bbox_ref'] == {'x': 5, 'y': 10, 'w': 5, 'h': 5}
def test_no_page_ref_defaults_empty(self):
"""Without page_ref cell, source_page defaults to empty string."""
@@ -1348,7 +1348,7 @@ class TestCellsToVocabEntriesPageRef:
'row_index': 0,
'col_type': 'column_en',
'text': 'world',
'bbox_pct': [10, 10, 30, 5],
'bbox_pct': {'x': 10, 'y': 10, 'w': 30, 'h': 5},
'confidence': 95.0,
'ocr_engine': 'tesseract',
},