test(suite): update all tests for streaming/locking architecture and mock parity

This commit is contained in:
2026-03-02 10:15:41 -05:00
parent 5de253b15b
commit 0b5552fa01
14 changed files with 130 additions and 77 deletions

View File

@@ -14,6 +14,7 @@ def test_gemini_cli_full_integration(live_gui: Any) -> None:
client = ApiHookClient("http://127.0.0.1:8999")
# 0. Reset session and enable history
client.click("btn_reset")
time.sleep(1.5)
client.set_value("auto_add_history", True)
# Switch to manual_slop project explicitly
client.select_list_item("proj_files", "manual_slop")
@@ -61,7 +62,8 @@ def test_gemini_cli_full_integration(live_gui: Any) -> None:
found_final = False
for entry in entries:
content = entry.get("content", "")
if "Hello from mock!" in content or "processed the tool results" in content:
success_markers = ["processed the tool results", "Here are the files", "Here are the lines", "Script hello.ps1 created successfully"]
if any(marker in content for marker in success_markers):
print(f"[TEST] Success! Found final message in history.")
found_final = True
break
@@ -78,6 +80,7 @@ def test_gemini_cli_rejection_and_history(live_gui: Any) -> None:
client = ApiHookClient("http://127.0.0.1:8999")
# 0. Reset session
client.click("btn_reset")
time.sleep(1.5)
client.set_value("auto_add_history", True)
client.select_list_item("proj_files", "manual_slop")
mock_script = os.path.abspath("tests/mock_gemini_cli.py")
@@ -115,11 +118,14 @@ def test_gemini_cli_rejection_and_history(live_gui: Any) -> None:
print("[TEST] Waiting for rejection in history...")
rejection_found = False
start_time = time.time()
while time.time() - start_time < 20:
while time.time() - start_time < 40:
session = client.get_session()
entries = session.get("session", {}).get("entries", [])
for entry in entries:
if "Tool execution was denied" in entry.get("content", ""):
role = entry.get("role", "unknown")
content = entry.get("content", "")
print(f"[TEST] History Entry: Role={role}, Content={content[:100]}...")
if "Tool execution was denied" in content or "USER REJECTED" in content:
rejection_found = True
break
if rejection_found: break