Botched: Need to do a higher reaosning model to fix this mess.

This commit is contained in:
2026-03-04 12:32:14 -05:00
parent 8d3fdb53d0
commit 01b3c26653
18 changed files with 180 additions and 132 deletions

View File

@@ -8,19 +8,19 @@ from events import EventEmitter
@pytest.fixture
def app_instance() -> Generator[type[App], None, None]:
"""
Fixture to create an instance of the gui_2.App class for testing.
It mocks functions that would render a window or block execution.
"""
Fixture to create an instance of the gui_2.App class for testing.
It mocks functions that would render a window or block execution.
"""
if not hasattr(ai_client, 'events') or ai_client.events is None:
ai_client.events = EventEmitter()
with (
patch('gui_2.load_config', return_value={'ai': {}, 'projects': {}}),
patch('src.models.load_config', return_value={'ai': {}, 'projects': {}}),
patch('gui_2.save_config'),
patch('gui_2.project_manager'),
patch('gui_2.session_logger'),
patch('gui_2.immapp.run'),
patch.object(App, '_load_active_project'),
patch.object(App, '_fetch_models'),
patch('src.app_controller.AppController._load_active_project'),
patch('src.app_controller.AppController._fetch_models'),
patch.object(App, '_load_fonts'),
patch.object(App, '_post_init')
):
@@ -43,4 +43,4 @@ def test_app_subscribes_to_events(app_instance: type[App]) -> None:
for call in calls:
handler = call.args[1]
assert hasattr(handler, '__self__')
assert handler.__self__ is app
assert handler.__self__ is app.controller