test(gui): Fix test_discussion_tabs_rendered mock assertion
The test was incorrectly asserting against mock_imgui.begin_tab_item instead of the newly refactored mock_imscope.tab_item context manager pattern.
This commit is contained in:
+20
-20
@@ -151,26 +151,6 @@ def set_current_tier(tier: Optional[str]) -> None:
|
||||
"""
|
||||
_local_storage.current_tier = tier
|
||||
|
||||
def get_comms_log_callback() -> Optional[Callable[[dict[str, Any]], None]]:
|
||||
"""
|
||||
|
||||
Returns the comms log callback (thread-local with global fallback).
|
||||
[C: src/multi_agent_conductor.py:run_worker_lifecycle]
|
||||
"""
|
||||
tl_cb = getattr(_local_storage, "comms_log_callback", None)
|
||||
if tl_cb: return tl_cb
|
||||
return comms_log_callback
|
||||
|
||||
def set_comms_log_callback(cb: Optional[Callable[[dict[str, Any]], None]]) -> None:
|
||||
"""
|
||||
|
||||
Sets the comms log callback (both global and thread-local).
|
||||
[C: src/app_controller.py:AppController._init_ai_and_hooks, src/multi_agent_conductor.py:run_worker_lifecycle]
|
||||
"""
|
||||
global comms_log_callback
|
||||
comms_log_callback = cb
|
||||
_local_storage.comms_log_callback = cb
|
||||
|
||||
# Increased to allow thorough code exploration before forcing a summary
|
||||
MAX_TOOL_ROUNDS: int = 10
|
||||
|
||||
@@ -270,6 +250,26 @@ COMMS_CLAMP_CHARS: int = 300
|
||||
|
||||
#region: Comms Log
|
||||
|
||||
def get_comms_log_callback() -> Optional[Callable[[dict[str, Any]], None]]:
|
||||
"""
|
||||
|
||||
Returns the comms log callback (thread-local with global fallback).
|
||||
[C: src/multi_agent_conductor.py:run_worker_lifecycle]
|
||||
"""
|
||||
tl_cb = getattr(_local_storage, "comms_log_callback", None)
|
||||
if tl_cb: return tl_cb
|
||||
return comms_log_callback
|
||||
|
||||
def set_comms_log_callback(cb: Optional[Callable[[dict[str, Any]], None]]) -> None:
|
||||
"""
|
||||
|
||||
Sets the comms log callback (both global and thread-local).
|
||||
[C: src/app_controller.py:AppController._init_ai_and_hooks, src/multi_agent_conductor.py:run_worker_lifecycle]
|
||||
"""
|
||||
global comms_log_callback
|
||||
comms_log_callback = cb
|
||||
_local_storage.comms_log_callback = cb
|
||||
|
||||
def _append_comms(direction: str, kind: str, payload: dict[str, Any]) -> None:
|
||||
"""
|
||||
[C: tests/test_ai_client_concurrency.py:run_t1, tests/test_ai_client_concurrency.py:run_t2, tests/test_mma_agent_focus_phase1.py:test_append_comms_has_source_tier_key, tests/test_mma_agent_focus_phase1.py:test_append_comms_source_tier_none_when_unset, tests/test_mma_agent_focus_phase1.py:test_append_comms_source_tier_set_when_current_tier_set, tests/test_mma_agent_focus_phase1.py:test_append_comms_source_tier_tier2]
|
||||
|
||||
@@ -58,7 +58,7 @@ def test_discussion_tabs_rendered(mock_gui):
|
||||
mock_imgui.begin_combo.assert_called_once_with("##disc_sel", 'main')
|
||||
mock_imgui.begin_tab_bar.assert_called_once_with('discussion_takes_tabs')
|
||||
|
||||
calls = [c[0][0] for c in mock_imgui.begin_tab_item.call_args_list]
|
||||
calls = [c[0][0] for c in mock_imscope.tab_item.call_args_list]
|
||||
assert 'Original###main' in calls
|
||||
assert 'Take 1###main_take_1' in calls
|
||||
assert 'Synthesis###Synthesis' in calls
|
||||
|
||||
Reference in New Issue
Block a user