From 3a7a715121a19b663d27103399f3b3f7fea03d12 Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Mon, 28 Sep 2026 21:23:09 +0100 Subject: [PATCH] test: derive the board footer family from the Brain, not a literal The footer-family test pinned the six-board family and went red once PyAutoBrain added the Nerves and Gut boards (config/policy.yaml board: boards:). Derive the expectation from _theme.board_links, the same read the renderer makes, so the next organ birth cannot re-break it. Refs PyAutoLabs/PyAutoMind#450 Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01CpGs8DxC5qA1MtHcmHeaBQ --- tests/test_board.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tests/test_board.py b/tests/test_board.py index 8684c8a3..a39d2c2b 100644 --- a/tests/test_board.py +++ b/tests/test_board.py @@ -139,9 +139,16 @@ def test_boundary_language_links_the_heart(): assert "https://someorg.github.io/PyAutoHeart/" in html -# The canonical board family, in the order `PyAutoBrain/config/policy.yaml` -# declares it. This board is `hands`, so its own chip never appears. -FAMILY_WITHOUT_HANDS = ["brain", "mind", "cortex", "memory", "heart", "organism"] +def _family_without_hands() -> list[str]: + """The canonical board family, in the order `PyAutoBrain/config/policy.yaml` + `board: boards:` declares it, minus this board (`hands`). + + Derived from the Brain — the same `_theme.board_links` read the renderer + makes — never written out here. A literal in this file pinned the + six-board family and went red the day the Nerves and the Gut got boards + (PyAutoMind#450); the next organ birth must not re-break it. + """ + return list(board.theme().board_links("", board.BOARD_KEY)) def _footer(html: str) -> str: @@ -157,7 +164,9 @@ def test_the_family_footer_carries_the_cortex_in_the_canonical_order(): `config/policy.yaml` lights it in every footer at once. """ footer = _footer(board.render(SNAP, "html")) - assert re.findall(r'data-organ="(\w+)"', footer) == FAMILY_WITHOUT_HANDS + family = _family_without_hands() + assert "cortex" in family and board.BOARD_KEY not in family + assert re.findall(r'data-organ="(\w+)"', footer) == family assert "https://someorg.github.io/PyAutoCortex/" in footer