refactor(api): make tool_handlers require a DeviceManager
Eliminates the silent fallback to DEFAULT_MANAGER that produced the DeviceNotFoundError incident. All existing callers already pass manager explicitly.
This commit is contained in:
@@ -64,3 +64,12 @@ def test_mcp_ui_tree_can_include_active_app_info() -> None:
|
||||
"activity": ".MainActivity",
|
||||
}
|
||||
assert isinstance(response["nodes"], list)
|
||||
|
||||
|
||||
def test_tool_handlers_requires_manager() -> None:
|
||||
"""D12: tool_handlers must not silently fall back to DEFAULT_MANAGER."""
|
||||
from api.mcp import tool_handlers
|
||||
import pytest
|
||||
|
||||
with pytest.raises(TypeError):
|
||||
tool_handlers() # type: ignore[call-arg]
|
||||
|
||||
Reference in New Issue
Block a user