MCPcopy Index your code
hub / github.com/MiniMax-AI/Mini-Agent / test_bash_output_monitoring

Function test_bash_output_monitoring

tests/test_bash_tool.py:102–129  ·  view source on GitHub ↗

Test monitoring background command output.

()

Source from the content-addressed store, hash-verified

100
101@pytest.mark.asyncio
102async def test_bash_output_monitoring():
103 """Test monitoring background command output."""
104 print("\n=== Testing Output Monitoring ===")
105
106 bash_tool = BashTool()
107
108 # Start background command
109 result = await bash_tool.execute(
110 command="for i in 1 2 3 4 5; do echo 'Line '$i; sleep 0.5; done", run_in_background=True
111 )
112
113 assert result.success
114 bash_id = result.bash_id
115 print(f"Started background command: {bash_id}")
116
117 bash_output_tool = BashOutputTool()
118
119 # Check output multiple times (incremental output)
120 for i in range(3):
121 await asyncio.sleep(1)
122 output_result = await bash_output_tool.execute(bash_id=bash_id)
123 assert output_result.success
124 print(f"\n--- Check #{i + 1} ---")
125 print(f"Output:\n{output_result.content}")
126
127 # Clean up
128 bash_kill_tool = BashKillTool()
129 await bash_kill_tool.execute(bash_id=bash_id)
130
131
132@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 6

executeMethod · 0.95
executeMethod · 0.95
executeMethod · 0.95
BashToolClass · 0.90
BashOutputToolClass · 0.90
BashKillToolClass · 0.90

Tested by

no test coverage detected