test(fixtures): replace sector-specific example material with generic, fictitious examples — green
Every fixture, test document, tool example and document now uses an invented kitchen-and-baking handbook series, written in this repository. The package's behaviour is unchanged; src/ changes are comments and help text only. - Generated fixtures are regenerated from their generators. Their structural counts are identical before and after: elements, images, rows, cells, headings, bookmarks and the witness inventory's per-document totals. The image-inbox and accounting documents are renamed kapittel-84-*. - tools/okf_accounting_gate.py: the two options that named one real corpus each are replaced by a generic, repeatable --corpus PATH with no default. Row 5 compares the PDF pair alone. Gate verdict unchanged: RED rows 2, 3, 6. - tools/okf_witness.py: the STS JSON reader for one publisher's delivery is removed, along with its three twins and five tests. The mutation harness loses W09. - docs/: 13 dated reports that documented runs on a retired reference corpus are removed, and 40 are neutralized. Dead links are removed, and no new dangling path is introduced. - The synthetic MCP-gate corpus and the residual probe words are neutral. Valgt: keep the `okf quality --fasit` bar value (the measured fraction, one corpus) and rewrite only its provenance, because the verdict stays unchanged and the number names nothing. Term check with the local list: 0 of 411 tracked files, 0 file names, 0 of 27 binary fixtures. Suite after git add: 2457 passed, 1 skipped. The base tree had 2460 passed and 2 skipped; five tests went with the JSON reader and four were added by the term check. ruff, ruff format and mypy --strict src/ are clean. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
1e7345a401
commit
9d1f4b14ed
174 changed files with 1889 additions and 6512 deletions
|
|
@ -60,7 +60,7 @@ def run_door_b(tmp_path: Path, *, profile: BundleProfile) -> Path:
|
|||
inbox.mkdir(parents=True, exist_ok=True)
|
||||
# Names ascend while numbers descend, so an index left in arrival order is
|
||||
# the exact reverse of the one the profile asks for.
|
||||
for name, number in (("alpha.md", "N300"), ("beta.md", "N200"), ("gamma.md", "N100")):
|
||||
for name, number in (("alpha.md", "Q300"), ("beta.md", "Q200"), ("gamma.md", "Q100")):
|
||||
(inbox / name).write_text(
|
||||
f"# {number} {name[:-3]}\n\nBody.\n", encoding="utf-8", newline=""
|
||||
)
|
||||
|
|
@ -78,7 +78,7 @@ def run_door_b(tmp_path: Path, *, profile: BundleProfile) -> Path:
|
|||
|
||||
def run_door_c(tmp_path: Path, *, profile: BundleProfile) -> Path:
|
||||
source = tmp_path / "source"
|
||||
for name, number in (("alpha.md", "N300"), ("beta.md", "N200"), ("gamma.md", "N100")):
|
||||
for name, number in (("alpha.md", "Q300"), ("beta.md", "Q200"), ("gamma.md", "Q100")):
|
||||
place(source, name, f"---\ntype: dataset\nnumber: {number}\n---\n\nBody.\n")
|
||||
_, bundle = run_with(tmp_path, StubImportGate(), profile=profile)
|
||||
return bundle
|
||||
|
|
@ -92,8 +92,8 @@ def test_both_doors_order_by_the_key_the_profile_names(tmp_path: Path) -> None:
|
|||
door_c = numbers_in(run_door_c(tmp_path / "c", profile=NUMBERED), NUMBERED)
|
||||
|
||||
# Both agree with the profile...
|
||||
assert door_b == ["N100", "N200", "N300"]
|
||||
assert door_c == ["N100", "N200", "N300"]
|
||||
assert door_b == ["Q100", "Q200", "Q300"]
|
||||
assert door_c == ["Q100", "Q200", "Q300"]
|
||||
# ...and therefore with each other. Stated separately on purpose: a door
|
||||
# that ignored the field would still produce a parseable index, and the
|
||||
# arrival order it would produce is the reverse of this one.
|
||||
|
|
@ -156,8 +156,8 @@ def test_the_concept_path_is_the_final_tie_break() -> None:
|
|||
the concept path, which for Door C is not the generated filename."""
|
||||
policy: IndexPolicy = NUMBERED.index
|
||||
entries = [
|
||||
entry("notes/alpha.md", "import-notes-alpha.md", number="N100"),
|
||||
entry("notes-beta.md", "import-notes-beta.md", number="N100"),
|
||||
entry("notes/alpha.md", "import-notes-alpha.md", number="Q100"),
|
||||
entry("notes-beta.md", "import-notes-beta.md", number="Q100"),
|
||||
]
|
||||
|
||||
for order in (entries, list(reversed(entries))):
|
||||
|
|
@ -170,9 +170,9 @@ def test_the_concept_path_is_the_final_tie_break() -> None:
|
|||
def test_descending_reverses_the_key_and_not_the_tie_break() -> None:
|
||||
policy = replace(NUMBERED.index, sort_order="descending")
|
||||
entries = [
|
||||
entry("a.md", "import-a.md", number="N100"),
|
||||
entry("c.md", "import-c.md", number="N300"),
|
||||
entry("b.md", "import-b.md", number="N300"),
|
||||
entry("a.md", "import-a.md", number="Q100"),
|
||||
entry("c.md", "import-c.md", number="Q300"),
|
||||
entry("b.md", "import-b.md", number="Q300"),
|
||||
]
|
||||
|
||||
assert [item.target for item in policy.sort_entries(entries)] == [
|
||||
|
|
@ -192,9 +192,9 @@ def test_the_missing_group_lands_where_the_policy_says_in_both_directions(
|
|||
"""
|
||||
policy = replace(NUMBERED.index, sort_order=order, sort_missing=missing)
|
||||
entries = [
|
||||
entry("a.md", "import-a.md", number="N100"),
|
||||
entry("a.md", "import-a.md", number="Q100"),
|
||||
entry("b.md", "import-b.md"),
|
||||
entry("c.md", "import-c.md", number="N300"),
|
||||
entry("c.md", "import-c.md", number="Q300"),
|
||||
]
|
||||
|
||||
present = (
|
||||
|
|
@ -210,7 +210,7 @@ def test_an_empty_facet_value_counts_as_missing() -> None:
|
|||
policy = replace(NUMBERED.index, sort_missing="last")
|
||||
entries = [
|
||||
entry("a.md", "import-a.md", number=""),
|
||||
entry("b.md", "import-b.md", number="N300"),
|
||||
entry("b.md", "import-b.md", number="Q300"),
|
||||
]
|
||||
|
||||
assert [item.target for item in policy.sort_entries(entries)] == [
|
||||
|
|
@ -225,14 +225,14 @@ def test_navigation_entries_stay_last_under_a_sort_key() -> None:
|
|||
# the file if the grouping were not applied over the ordering.
|
||||
policy = replace(NUMBERED.index, sort_missing="first")
|
||||
entries = [
|
||||
entry("krav/n900.md", "n900.md", number="N900"),
|
||||
entry("krav/q900.md", "q900.md", number="Q900"),
|
||||
IndexEntry(label="sub (underkapitler)", target=f"sub/{NUMBERED.index.name}"),
|
||||
entry("krav/n100.md", "n100.md", number="N100"),
|
||||
entry("krav/q100.md", "q100.md", number="Q100"),
|
||||
]
|
||||
|
||||
assert [item.target for item in policy.sort_entries(entries)] == [
|
||||
"n100.md",
|
||||
"n900.md",
|
||||
"q100.md",
|
||||
"q900.md",
|
||||
f"sub/{NUMBERED.index.name}",
|
||||
]
|
||||
|
||||
|
|
@ -251,19 +251,19 @@ def test_door_c_orders_within_a_run_and_never_re_orders_an_earlier_one(
|
|||
with no test that goes red is not a guarantee.
|
||||
"""
|
||||
source = tmp_path / "source"
|
||||
place(source, "b.md", "---\ntype: dataset\nnumber: N200\n---\n\nBody.\n")
|
||||
place(source, "c.md", "---\ntype: dataset\nnumber: N300\n---\n\nBody.\n")
|
||||
place(source, "b.md", "---\ntype: dataset\nnumber: Q200\n---\n\nBody.\n")
|
||||
place(source, "c.md", "---\ntype: dataset\nnumber: Q300\n---\n\nBody.\n")
|
||||
_, bundle = run_with(tmp_path, StubImportGate(), profile=NUMBERED)
|
||||
|
||||
place(source, "a.md", "---\ntype: dataset\nnumber: N100\n---\n\nBody.\n")
|
||||
place(source, "a.md", "---\ntype: dataset\nnumber: Q100\n---\n\nBody.\n")
|
||||
run_with(tmp_path, StubImportGate(), profile=NUMBERED)
|
||||
|
||||
# N100 sorts first and lands last, because round one's lines stay put.
|
||||
assert numbers_in(bundle, NUMBERED) == ["N200", "N300", "N100"]
|
||||
# Q100 sorts first and lands last, because round one's lines stay put.
|
||||
assert numbers_in(bundle, NUMBERED) == ["Q200", "Q300", "Q100"]
|
||||
# The same three concepts merged in ONE run do come out ordered — so the
|
||||
# difference above is the append bound, not an ordering that failed.
|
||||
assert numbers_in(run_door_c(tmp_path / "fresh", profile=NUMBERED), NUMBERED) == [
|
||||
"N100",
|
||||
"N200",
|
||||
"N300",
|
||||
"Q100",
|
||||
"Q200",
|
||||
"Q300",
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue