feat(testing): stabilize simulation suite and fix gemini caching
This commit is contained in:
@@ -32,21 +32,19 @@ def test_execution_simulation_run():
|
||||
}
|
||||
mock_client.get_session.return_value = mock_session
|
||||
|
||||
# Mock script confirmation event
|
||||
mock_client.wait_for_event.side_effect = [
|
||||
{"type": "script_confirmation_required", "script": "dir"},
|
||||
None # Second call returns None to end the loop
|
||||
]
|
||||
|
||||
with patch('simulation.sim_base.WorkflowSimulator') as mock_sim_class:
|
||||
mock_sim = MagicMock()
|
||||
mock_sim_class.return_value = mock_sim
|
||||
|
||||
# We need a way to trigger show_confirm_modal = True
|
||||
# In sim_execution.py, it's called after run_discussion_turn
|
||||
# I'll mock run_discussion_turn to set it
|
||||
def run_side_effect(msg):
|
||||
vals["show_confirm_modal"] = True
|
||||
|
||||
mock_sim.run_discussion_turn.side_effect = run_side_effect
|
||||
|
||||
sim = ExecutionSimulation(mock_client)
|
||||
sim.run()
|
||||
|
||||
# Verify calls
|
||||
mock_sim.run_discussion_turn.assert_called()
|
||||
mock_sim.run_discussion_turn_async.assert_called()
|
||||
mock_client.click.assert_called_with("btn_approve_script")
|
||||
|
||||
Reference in New Issue
Block a user