""" ANTI-SIMPLIFICATION: These tests verify the Simulation of AI Settings interactions. They MUST NOT be simplified. They ensure that changes to provider and model selections are properly simulated and verified via the ApiHookClient. """ from unittest.mock import MagicMock, patch import os import sys # Ensure project root is in path sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) from simulation.sim_ai_settings import AISettingsSimulation def test_ai_settings_simulation_run() -> None: """ Verifies that AISettingsSimulation correctly cycles through models to test the settings UI components. """ mock_client = MagicMock() mock_client.wait_for_server.return_value = True mock_client.get_value.side_effect = lambda key: { "current_provider": "minimax", "current_model": "MiniMax-M2.7" }.get(key) with patch('simulation.sim_base.WorkflowSimulator') as mock_sim_class: mock_sim = MagicMock() mock_sim_class.return_value = mock_sim sim = AISettingsSimulation(mock_client) vals = {"current_provider": "minimax", "current_model": "MiniMax-M2.7"} def side_effect(key): return vals.get(key)