fix: Multiple test fixes and improvements

- Fix mock_gemini_cli.py to use src/aggregate.py (moved to src directory)
- Add wait_for_event method to ApiHookClient for simulation tests
- Fix custom_callback path in app_controller to use absolute path
- Fix test_gui2_parity.py to use correct callback file path
This commit is contained in:
2026-03-05 21:18:25 -05:00
parent d2481b2de7
commit 4ce6348978
4 changed files with 16 additions and 3 deletions

View File

@@ -72,6 +72,17 @@ class ApiHookClient:
def clear_events(self) -> list[dict[str, Any]]:
return self.get_events()
def wait_for_event(self, event_type: str, timeout: int = 5) -> dict[str, Any] | None:
start = time.time()
while time.time() - start < timeout:
events = self.get_events()
for ev in events:
if ev.get("type") == event_type or ev.get("event_type") == event_type:
return ev
time.sleep(0.2)
return None
def post_gui(self, payload: dict) -> dict[str, Any]:
"""Pushes an event to the GUI's SyncEventQueue via the /api/gui endpoint."""
return self._make_request('POST', '/api/gui', data=payload) or {}