test(fixtures): the STS fixtures and fixture codes are fictitious
Three STS fixtures still carried the section titles and labels of one real reference document, and three identifiers were copies of its codes with a letter or a word swapped. They now describe an invented kitchen counter and cookbook series: the titles, labels and descriptions of sts-identity.xml, sts-inherit.xml and sts-empty-label.xml, the P350/P351 document codes, the 99-0001 delivery prefix and chapter 7 of the image and accounting corpora. Generated fixtures are regenerated and the witness inventory's per-document totals are identical before and after; only names and text move. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
5359394a4f
commit
88cf67f12e
65 changed files with 396 additions and 390 deletions
|
|
@ -24,32 +24,32 @@ from __future__ import annotations
|
|||
from llm_ingestion_okf.structure import derive_document_structure
|
||||
|
||||
POINTER = (
|
||||
"# 84 Boller\n\n"
|
||||
"Hevetidsklasse er gitt i tabell 84-2, jf. Q500.\n\n"
|
||||
"\n"
|
||||
"Image: graphics/tabell-84-2.png (120x90 px) -- Tabell 84-2\n\n"
|
||||
"# 7 Boller\n\n"
|
||||
"Hevetidsklasse er gitt i tabell 7-2, jf. Q500.\n\n"
|
||||
"\n"
|
||||
"Image: graphics/tabell-7-2.png (120x90 px) -- Tabell 7-2\n\n"
|
||||
"Se ellers [Q100](q100.md).\n"
|
||||
)
|
||||
|
||||
|
||||
def test_an_image_pointer_is_not_a_reference() -> None:
|
||||
structure = derive_document_structure(POINTER, source_file="p761.xml")
|
||||
assert "/assets/e54e5f5da0e8-tabell-84-2.png" not in structure.references
|
||||
structure = derive_document_structure(POINTER, source_file="p350.xml")
|
||||
assert "/assets/e54e5f5da0e8-tabell-7-2.png" not in structure.references
|
||||
|
||||
|
||||
def test_the_links_beside_it_still_are() -> None:
|
||||
"""The known-positive in the same text: masking must not eat real edges."""
|
||||
structure = derive_document_structure(POINTER, source_file="p761.xml")
|
||||
structure = derive_document_structure(POINTER, source_file="p350.xml")
|
||||
assert "q100.md" in structure.references
|
||||
|
||||
|
||||
def test_the_asset_name_does_not_leak_a_number_into_references() -> None:
|
||||
"""A masked span is still masked: `84-2` inside the file name is not a subject.
|
||||
"""A masked span is still masked: `7-2` inside the file name is not a subject.
|
||||
|
||||
The span is blanked rather than deleted for exactly this reason -- deleting
|
||||
would move every later offset and break first-appearance order, and leaving
|
||||
it would let the number scan read an identifier out of a file name.
|
||||
"""
|
||||
structure = derive_document_structure(POINTER, source_file="p761.xml")
|
||||
structure = derive_document_structure(POINTER, source_file="p350.xml")
|
||||
assert all("ASSETS" not in subject.upper() for subject in structure.references)
|
||||
assert "Q500" in structure.references
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue