refactor(tests): Update test suite and API hooks for AppController architecture

This commit is contained in:
2026-03-04 11:38:36 -05:00
parent 8642277ef4
commit f2b25757eb
6 changed files with 214 additions and 141 deletions

View File

@@ -1,12 +1,12 @@
import pytest
from unittest.mock import MagicMock, patch
from gui_2 import App
from events import UserRequestEvent
from src.events import UserRequestEvent
@pytest.fixture
def mock_gui() -> App:
with (
patch('gui_2.load_config', return_value={
patch('src.models.load_config', return_value={
"ai": {"provider": "gemini", "model": "model-1"},
"projects": {"paths": [], "active": ""},
"gui": {"show_windows": {}}
@@ -15,8 +15,8 @@ def mock_gui() -> App:
patch('gui_2.project_manager.migrate_from_legacy_config', return_value={}),
patch('gui_2.project_manager.save_project'),
patch('gui_2.session_logger.open_session'),
patch('gui_2.App._init_ai_and_hooks'),
patch('gui_2.App._fetch_models')
patch('src.app_controller.AppController._init_ai_and_hooks'),
patch('src.app_controller.AppController._fetch_models')
):
gui = App()
return gui