fix: align tests with the ten-value pack result

Two test modules still unpacked nine values from verify_pack_against_platform. The category evidence joined readers with semicolons, which the prose rule refuses on generated pages, and three comments used clause semicolons.
This commit is contained in:
Abdessamad Derraz committed 2026-10-22 06:23:15 +02:00
1 parent 8ba65de1ca
commit a0b27d612d
7 files changed
+13 -13

No files matched your search

+1 -1
View File
@@ -24,7 +24,7 @@ from typing import Iterable, Iterator, TextIO
_UNSAFE = re.compile(r"[\x00-\x1f\x7f*?\[\]\\]+")
_SPACES = re.compile(r" {2,}")
# A system id becomes a bash array subscript and a menu key in the launcher.
# Every manifest uses slugs; anything else is dropped, never cleaned into one.
# Every manifest uses slugs, and anything else is dropped, never cleaned into one.
_SYSTEM_ID = re.compile(r"[A-Za-z0-9._-]+")
+3 -3
View File
@@ -2067,13 +2067,13 @@ def _category_evidence_md(evidence: dict) -> str:
readers = []
for reader in evidence["read_by"]:
refs = [
f"`{e['name']}` (`{e['source_ref']}`)" if e.get("source_ref") else f"`{e['name']}`"
f"`{e['name']}` at `{e['source_ref']}`" if e.get("source_ref") else f"`{e['name']}`"
for e in reader.get("entries", [])
]
name = (_emulator_link(reader["emulator"], "../")
if reader["emulator"] != "launcher" else "the platform's launcher")
readers.append(f"{name}: {', '.join(refs)}" if refs else f"{name} (by {reader['proof']})")
return "Read by " + "; ".join(readers)
readers.append(f"{name} ({', '.join(refs)})" if refs else f"{name} (by {reader['proof']})")
return "Read by " + ", ".join(readers)
examined = evidence.get("cores_examined") or []
cores = ("cores examined: " + ", ".join(_emulator_link(c, "../") for c in examined)
if examined else "no core examined")
+4 -4
View File
@@ -1637,14 +1637,14 @@ def category_evidence_text(evidence: dict) -> str:
readers = []
for reader in evidence["read_by"]:
refs = [
f"{e['name']} ({e['source_ref']})" if e.get("source_ref") else e["name"]
f"{e['name']} at {e['source_ref']}" if e.get("source_ref") else e["name"]
for e in reader.get("entries", [])
]
readers.append(
f"{reader['emulator']}: {', '.join(refs)}" if refs
f"{reader['emulator']} ({', '.join(refs)})" if refs
else f"{reader['emulator']} (by {reader['proof']})"
)
return "read by " + "; ".join(readers)
return "read by " + ", ".join(readers)
examined = evidence.get("cores_examined") or []
cores = f"cores examined: {', '.join(examined)}" if examined else "no core examined"
if evidence.get("unsettled"):
@@ -1682,7 +1682,7 @@ def _print_detail_entries(details: list[dict], seen: set[str], verbose: bool) ->
continue
label = _NOT_FIRMWARE.get(d.get("category", BIOS))
if label:
# Counted on their own line; named on request.
# Counted on their own line, named on request.
if verbose:
seen.add(key)
print(f" MISSING ({label}): {key}")
+1 -1
View File
@@ -5270,7 +5270,7 @@ struct BurnDriver BurnDrvneogeo = {
def test_213b_absent_game_data_is_counted_apart(self):
"""Game data the collection lacks is counted apart from the pack's
errors; firmware the collection lacks stays one."""
errors, while firmware the collection lacks stays one."""
import tempfile
from generate_pack import generate_pack, verify_pack_against_platform
+1 -1
View File
@@ -85,7 +85,7 @@ class Evidence(unittest.TestCase):
"emulator": "devilutionx", "proof": "name",
"entries": [{"name": "diabdat.mpq", "source_ref": "Source/init.cpp:120"}]}])
self.assertEqual(verify.category_evidence_text(found),
"read by devilutionx: diabdat.mpq (Source/init.cpp:120)")
"read by devilutionx (diabdat.mpq at Source/init.cpp:120)")
def test_unread_names_the_cores_examined(self):
found = self.cats.explain({"name": "hardwareconfig.xml"},
+1 -1
View File
@@ -73,7 +73,7 @@ class CoreFilesAsTheBuilderPlacesThem(unittest.TestCase):
)
def test_a_path_the_platform_file_holds_is_not_a_core_file(self):
ok, _checked, _present, errors, _bc, _bp, core_checked, core_present, _ex = (
ok, _checked, _present, errors, _bc, _bp, core_checked, core_present, _ex, _absent = (
self._check(b"core file")
)
self.assertTrue(ok, errors)
+2 -2
View File
@@ -22,7 +22,7 @@ sys.path.insert(0, str(REPO_ROOT / "scripts"))
def _ok_result() -> tuple:
return (True, 0, 0, [], 1, 1, 1, 1, 0)
return (True, 0, 0, [], 1, 1, 1, 1, 0, 0)
class VerifyPackChoice(unittest.TestCase):
@@ -125,7 +125,7 @@ class VerifyPackChoice(unittest.TestCase):
pack = f"{self.stem}_BIOS_Pack.zip"
self._touch(pack)
out, err = io.StringIO(), io.StringIO()
failed = (False, 0, 0, ["x: missing"], 1, 0, 1, 1, 0)
failed = (False, 0, 0, ["x: missing"], 1, 0, 1, 1, 0, 0)
with mock.patch.object(self.gp, "verify_pack_against_platform",
return_value=failed), \
contextlib.redirect_stdout(out), contextlib.redirect_stderr(err), \