(isolated_config)
| 122 | # F. Engine end-to-end on a NullUIHost surface — no headless error (unlike pickers) |
| 123 | # --------------------------------------------------------------------------- # |
| 124 | async def test_engine_succeeds_headless(isolated_config): |
| 125 | tmp = isolated_config |
| 126 | _set_servers({"a": {"name": "alpha"}}) |
| 127 | reg = CommandRegistry() |
| 128 | reg.register(MCP_COMMAND) |
| 129 | ctx = create_command_context(workspace_root=tmp, cwd=tmp) # ui=None → engine subs NullUIHost |
| 130 | eng = CommandEngine(registry=reg, workspace_root=tmp, context=ctx) |
| 131 | |
| 132 | result = await eng.execute("/mcp") |
| 133 | |
| 134 | assert result.success is True |
| 135 | assert result.result_type == "text" |
| 136 | assert result.text.startswith("MCP servers:") |
nothing calls this directly
no test coverage detected