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
56
tests/fixtures/make_image_fixtures.py
vendored
56
tests/fixtures/make_image_fixtures.py
vendored
|
|
@ -88,7 +88,7 @@ PDF_GRAY_SAMPLES = bytes([0, 60, 120, 180, 20, 80, 140, 200, 40, 100, 160, 255])
|
|||
PDF_JPEG_WIDTH, PDF_JPEG_HEIGHT = 360, 269
|
||||
|
||||
PDF_CONTENT = (
|
||||
b"BT /F1 12 Tf 20 170 Td (Hevetidsklasse er gitt i tabell 84-2) Tj ET\n"
|
||||
b"BT /F1 12 Tf 20 170 Td (Hevetidsklasse er gitt i tabell 7-2) Tj ET\n"
|
||||
b"q 80 0 0 60 20 90 cm /ImFlate Do Q\n"
|
||||
b"q 80 0 0 60 20 20 cm /ImJpeg Do Q\n"
|
||||
)
|
||||
|
|
@ -153,15 +153,15 @@ def build_image_pdf() -> bytes:
|
|||
# the gate counts it as found-and-not-carried rather than as absent.
|
||||
|
||||
HTML_DOCUMENT = """<!doctype html>
|
||||
<html><head><title>Kapittel 84</title></head>
|
||||
<html><head><title>Kapittel 7</title></head>
|
||||
<body>
|
||||
<h1>84 Brød og boller</h1>
|
||||
<p>Hevetidsklasse for de enkelte deigtyper er gitt i tabell 84-2.</p>
|
||||
<img src="graphics/tabell-84-2.png" alt="Tabell 84-2 Hevetidsklasser">
|
||||
<h1>7 Brød og boller</h1>
|
||||
<p>Hevetidsklasse for de enkelte deigtyper er gitt i tabell 7-2.</p>
|
||||
<img src="graphics/tabell-7-2.png" alt="Tabell 7-2 Hevetidsklasser">
|
||||
<p>Figuren under viser prinsippet.</p>
|
||||
<figure>
|
||||
<img src="graphics/figur-84-1.png" alt="Figur 84-1 Prinsippskisse">
|
||||
<figcaption>Figur 84-1 Prinsippskisse</figcaption>
|
||||
<img src="graphics/figur-7-1.png" alt="Figur 7-1 Prinsippskisse">
|
||||
<figcaption>Figur 7-1 Prinsippskisse</figcaption>
|
||||
</figure>
|
||||
<p>Og en som ligger et annet sted:</p>
|
||||
<img src="https://example.invalid/ekstern.png" alt="Ekstern figur">
|
||||
|
|
@ -178,18 +178,18 @@ HTML_DOCUMENT = """<!doctype html>
|
|||
|
||||
STS_DOCUMENT = """<?xml version="1.0" encoding="UTF-8"?>
|
||||
<standard xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<front><std-ident><doc-number>P761</doc-number></std-ident></front>
|
||||
<front><std-ident><doc-number>P350</doc-number></std-ident></front>
|
||||
<body>
|
||||
<sec>
|
||||
<label>84</label>
|
||||
<label>7</label>
|
||||
<title>Brød og boller</title>
|
||||
<sec>
|
||||
<label>84.1</label>
|
||||
<label>7.1</label>
|
||||
<title>Hevetider</title>
|
||||
<p>Hevetidsklasse er gitt i tabell 84-2.</p>
|
||||
<graphic xlink:href="graphics/tabell-84-2.png"/>
|
||||
<p>Figur 84-1 viser prinsippet.</p>
|
||||
<graphic xlink:href="figur-84-1.png"/>
|
||||
<p>Hevetidsklasse er gitt i tabell 7-2.</p>
|
||||
<graphic xlink:href="graphics/tabell-7-2.png"/>
|
||||
<p>Figur 7-1 viser prinsippet.</p>
|
||||
<graphic xlink:href="figur-7-1.png"/>
|
||||
</sec>
|
||||
</sec>
|
||||
</body>
|
||||
|
|
@ -217,20 +217,20 @@ def build_docx() -> bytes:
|
|||
"word/_rels/document.xml.rels": _XML
|
||||
+ '<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">'
|
||||
+ '<Relationship Id="rIdImg" Type="http://schemas.openxmlformats.org/officeDocument'
|
||||
+ '/2006/relationships/image" Target="media/tabell-84-2.png"/></Relationships>',
|
||||
"word/media/tabell-84-2.png": image,
|
||||
+ '/2006/relationships/image" Target="media/tabell-7-2.png"/></Relationships>',
|
||||
"word/media/tabell-7-2.png": image,
|
||||
"word/document.xml": _XML
|
||||
+ '<w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"'
|
||||
+ ' xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"'
|
||||
+ ' xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"'
|
||||
+ ' xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"'
|
||||
+ ' xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"><w:body>'
|
||||
+ "<w:p><w:r><w:t>Hevetidsklasse er gitt i tabell 84-2.</w:t></w:r></w:p>"
|
||||
+ "<w:p><w:r><w:t>Hevetidsklasse er gitt i tabell 7-2.</w:t></w:r></w:p>"
|
||||
+ '<w:p><w:r><w:drawing><wp:inline><wp:extent cx="381000" cy="285750"/>'
|
||||
+ '<wp:docPr id="1" name="Bilde 1" descr="Tabell 84-2 Hevetidsklasser"/>'
|
||||
+ '<wp:docPr id="1" name="Bilde 1" descr="Tabell 7-2 Hevetidsklasser"/>'
|
||||
+ '<a:graphic><a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006'
|
||||
+ '/picture"><pic:pic><pic:nvPicPr><pic:cNvPr id="1" name="tabell-84-2.png"'
|
||||
+ ' descr="Tabell 84-2 Hevetidsklasser"/><pic:cNvPicPr/></pic:nvPicPr>'
|
||||
+ '/picture"><pic:pic><pic:nvPicPr><pic:cNvPr id="1" name="tabell-7-2.png"'
|
||||
+ ' descr="Tabell 7-2 Hevetidsklasser"/><pic:cNvPicPr/></pic:nvPicPr>'
|
||||
+ '<pic:blipFill><a:blip r:embed="rIdImg"/><a:stretch><a:fillRect/></a:stretch>'
|
||||
+ '</pic:blipFill><pic:spPr><a:xfrm><a:off x="0" y="0"/>'
|
||||
+ '<a:ext cx="381000" cy="285750"/></a:xfrm>'
|
||||
|
|
@ -310,17 +310,17 @@ if __name__ == "__main__":
|
|||
|
||||
# FIVE DISTINCT STEMS. One stem across five extensions is refused by the
|
||||
# door's own SS 3 collision rule -- measured while building this fixture:
|
||||
# `kapittel-84.{pdf,docx,pptx}` gave `inbox_slug_collision: 2/7` and two of
|
||||
# `kapittel-7.{pdf,docx,pptx}` gave `inbox_slug_collision: 2/7` and two of
|
||||
# the five readers were never exercised at all, with the gate reporting a
|
||||
# carrying defect that was really a fixture defect.
|
||||
written: list[tuple[str, bytes]] = [
|
||||
("graphics/tabell-84-2.png", png(120, 90, value=0x20)),
|
||||
("graphics/figur-84-1.png", png(64, 48, value=0x80)),
|
||||
("kapittel-84-web.html", HTML_DOCUMENT.encode("utf-8")),
|
||||
("kapittel-84-sts.xml", STS_DOCUMENT.encode("utf-8")),
|
||||
("kapittel-84-tabell.pdf", build_image_pdf()),
|
||||
("kapittel-84-notat.docx", build_docx()),
|
||||
("kapittel-84-presentasjon.pptx", build_pptx()),
|
||||
("graphics/tabell-7-2.png", png(120, 90, value=0x20)),
|
||||
("graphics/figur-7-1.png", png(64, 48, value=0x80)),
|
||||
("kapittel-7-web.html", HTML_DOCUMENT.encode("utf-8")),
|
||||
("kapittel-7-sts.xml", STS_DOCUMENT.encode("utf-8")),
|
||||
("kapittel-7-tabell.pdf", build_image_pdf()),
|
||||
("kapittel-7-notat.docx", build_docx()),
|
||||
("kapittel-7-presentasjon.pptx", build_pptx()),
|
||||
]
|
||||
for name, payload in written:
|
||||
(IMAGES / name).write_bytes(payload)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue