When enable_guards=False, no guard checks are performed.
(self)
| 304 | |
| 305 | @pytest.mark.asyncio |
| 306 | async def test_guards_disabled(self): |
| 307 | """When enable_guards=False, no guard checks are performed.""" |
| 308 | tm = FakeToolManager(result="ok") |
| 309 | backend = McpToolBackend(tm, enable_guards=False) |
| 310 | |
| 311 | with patch( |
| 312 | "mcp_cli.planning.backends._check_guards", |
| 313 | ) as mock_check: |
| 314 | request = ToolExecutionRequest( |
| 315 | tool_name="read_file", |
| 316 | args={}, |
| 317 | step_id="step-8", |
| 318 | ) |
| 319 | result = await backend.execute_tool(request) |
| 320 | |
| 321 | assert result.success |
| 322 | mock_check.assert_not_called() |
| 323 | |
| 324 | |
| 325 | class TestCheckGuards: |
nothing calls this directly
no test coverage detected