conductor(checkpoint): Test integrity audit complete
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
"""
|
||||
ANTI-SIMPLIFICATION: These tests verify the infrastructure of the user action simulator.
|
||||
They MUST NOT be simplified. They ensure that the simulator correctly interacts with the
|
||||
ApiHookClient to mimic real user behavior, which is critical for regression detection.
|
||||
"""
|
||||
from unittest.mock import MagicMock, patch
|
||||
import os
|
||||
import sys
|
||||
@@ -9,14 +14,22 @@ sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "s
|
||||
from simulation.sim_base import BaseSimulation
|
||||
|
||||
def test_base_simulation_init() -> None:
|
||||
"""
|
||||
Verifies that the BaseSimulation initializes the ApiHookClient correctly.
|
||||
"""
|
||||
with patch('simulation.sim_base.ApiHookClient') as mock_client_class:
|
||||
mock_client = MagicMock()
|
||||
mock_client_class.return_value = mock_client
|
||||
sim = BaseSimulation()
|
||||
# ANTI-SIMPLIFICATION: Ensure the client is stored
|
||||
assert sim.client == mock_client
|
||||
assert sim.sim is not None
|
||||
|
||||
def test_base_simulation_setup() -> None:
|
||||
"""
|
||||
Verifies that the setup routine correctly resets the GUI state
|
||||
and initializes a clean temporary project for simulation.
|
||||
"""
|
||||
mock_client = MagicMock()
|
||||
mock_client.wait_for_server.return_value = True
|
||||
with patch('simulation.sim_base.WorkflowSimulator') as mock_sim_class:
|
||||
@@ -24,6 +37,8 @@ def test_base_simulation_setup() -> None:
|
||||
mock_sim_class.return_value = mock_sim
|
||||
sim = BaseSimulation(mock_client)
|
||||
sim.setup("TestSim")
|
||||
|
||||
# ANTI-SIMPLIFICATION: Verify exact sequence of setup calls
|
||||
mock_client.wait_for_server.assert_called()
|
||||
mock_client.click.assert_any_call("btn_reset")
|
||||
mock_sim.setup_new_project.assert_called()
|
||||
|
||||
Reference in New Issue
Block a user