fix(tests): rewrite Robot for-loop as comprehension to preserve indentation
CI / lint (pull_request) Successful in 48s
CI / typecheck (pull_request) Successful in 1m10s
CI / quality (pull_request) Successful in 56s
CI / security (pull_request) Successful in 1m23s
CI / build (pull_request) Successful in 35s
CI / push-validation (pull_request) Successful in 36s
CI / helm (pull_request) Successful in 37s
CI / unit_tests (pull_request) Successful in 7m12s
CI / docker (pull_request) Successful in 1m42s
CI / coverage (pull_request) Successful in 14m19s
CI / integration_tests (pull_request) Successful in 21m38s
CI / status-check (pull_request) Successful in 3s

The Robot Framework `Catenate` keyword treats 2+ consecutive spaces as
field separators and strips them, which breaks Python's mandatory
indentation when a nested `assert` follows a `for` line. As a result
the "TUI Help Command Groups By Namespace" test produced a script with
a de-indented `assert` body, causing an IndentationError under
`python -c` and the test to fail with rc=1.

Rewrite the namespace-presence check as a single-line list
comprehension over the expected group headers, mirroring the pattern
already used by the sibling "Lists All Catalogued Commands" test in
the same file. The check is semantically equivalent — both fail with
the same diagnostic message when a group header is missing — but the
flattened form survives Robot's argument tokenisation intact.

ISSUES CLOSED: #3434
This commit is contained in:
2026-05-31 23:00:02 -04:00
parent 9131523a7f
commit 9215894b98
+2 -2
View File
@@ -34,8 +34,8 @@ TUI Help Command Groups By Namespace
... state = MagicMock()
... router = TuiCommandRouter(persona_registry=registry, persona_state=state)
... result = router.handle("help", session_id="default")
... for group in ("Session:", "Persona:", "Plan:", "Utility:"):
... assert group in result, f"Missing group header {group!r} in output"
... missing = [g for g in ("Session:", "Persona:", "Plan:", "Utility:") if g not in result]
... assert not missing, f"Missing group headers: {missing}"
... print("tui-help-groups-ok")
${result}= Run Process ${PYTHON} -c ${script} shell=False stderr=STDOUT
Should Be Equal As Integers ${result.rc} 0