mirror of
https://github.com/lllin000/PaperForge.git
synced 2026-07-22 06:50:53 +00:00
test: add OCR pipeline v3 parity gate
This commit is contained in:
parent
cb685f73d0
commit
1a81817d7f
1 changed files with 21 additions and 0 deletions
|
|
@ -179,3 +179,24 @@ def test_post_match_normalize_commits_shadow_role_back_to_public_role(monkeypatc
|
|||
assert out_rows[0]["role_candidate"] == "figure_caption_candidate"
|
||||
assert out_rows[0]["role_source"] == "shadow_post_match"
|
||||
assert doc is not None
|
||||
|
||||
|
||||
|
||||
def test_build_structured_blocks_legacy_default_still_matches_seed_contract() -> None:
|
||||
from paperforge.worker.ocr_blocks import build_structured_blocks
|
||||
|
||||
raw_blocks = [
|
||||
{
|
||||
"paper_id": "test_paper",
|
||||
"block_id": "r1",
|
||||
"page": 1,
|
||||
"raw_label": "text",
|
||||
"text": "Minimal body text.",
|
||||
"bbox": [100, 100, 420, 140],
|
||||
}
|
||||
]
|
||||
|
||||
rows, _ = build_structured_blocks(raw_blocks)
|
||||
|
||||
assert rows[0]["role"]
|
||||
assert rows[0]["seed_role"]
|
||||
Loading…
Reference in a new issue