chore: apply ruff auto-fixes and remove dead AST scripts
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import sys
|
||||
import json
|
||||
import subprocess
|
||||
import os
|
||||
|
||||
def main() -> None:
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
import pytest
|
||||
import sys
|
||||
import os
|
||||
|
||||
# Ensure project root is in path
|
||||
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
||||
|
||||
import ai_client
|
||||
|
||||
def test_agent_capabilities_listing() -> None:
|
||||
pass
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import pytest
|
||||
import sys
|
||||
import os
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
# Ensure project root is in path
|
||||
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import pytest
|
||||
from unittest.mock import MagicMock, patch
|
||||
from unittest.mock import patch
|
||||
import ai_client
|
||||
|
||||
def test_ai_client_send_gemini_cli() -> None:
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import pytest
|
||||
from unittest.mock import patch, MagicMock
|
||||
import ai_client
|
||||
|
||||
def test_list_models_gemini_cli() -> None:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import pytest
|
||||
import textwrap
|
||||
from scripts.ai_style_formatter import format_code
|
||||
|
||||
|
||||
@@ -36,20 +36,7 @@ def test_event_emission() -> None:
|
||||
callback.assert_called_once_with(payload={"data": 123})
|
||||
|
||||
def test_send_emits_events() -> None:
|
||||
with patch("ai_client._send_gemini") as mock_send_gemini, \
|
||||
patch("ai_client._send_anthropic") as mock_send_anthropic:
|
||||
mock_send_gemini.return_value = "gemini response"
|
||||
start_callback = MagicMock()
|
||||
response_callback = MagicMock()
|
||||
ai_client.events.on("request_start", start_callback)
|
||||
ai_client.events.on("response_received", response_callback)
|
||||
ai_client.set_provider("gemini", "gemini-2.5-flash-lite")
|
||||
ai_client.send("context", "message")
|
||||
# We mocked _send_gemini so it doesn't emit events inside.
|
||||
# But wait, ai_client.send itself emits request_start and response_received?
|
||||
# Actually, ai_client.send delegates to _send_gemini.
|
||||
# Let's mock _gemini_client instead to let _send_gemini run and emit events.
|
||||
pass
|
||||
pytest.fail("TODO: This test is mocked incorrectly and asserts nothing. Use _proper version below.")
|
||||
|
||||
def test_send_emits_events_proper() -> None:
|
||||
with patch("ai_client._ensure_gemini_client"), \
|
||||
@@ -72,7 +59,6 @@ def test_send_emits_events_proper() -> None:
|
||||
assert kwargs['payload']['provider'] == 'gemini'
|
||||
|
||||
def test_send_emits_tool_events() -> None:
|
||||
import mcp_client
|
||||
with patch("ai_client._ensure_gemini_client"), \
|
||||
patch("ai_client._gemini_client") as mock_client, \
|
||||
patch("mcp_client.dispatch") as mock_dispatch:
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
import pytest
|
||||
import requests
|
||||
from unittest.mock import MagicMock, patch
|
||||
import threading
|
||||
import time
|
||||
import json
|
||||
from unittest.mock import patch
|
||||
import sys
|
||||
import os
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import pytest
|
||||
import sys
|
||||
import os
|
||||
from typing import Any
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import pytest
|
||||
from file_cache import ASTParser
|
||||
|
||||
def test_ast_parser_get_curated_view() -> None:
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import asyncio
|
||||
import pytest
|
||||
from events import AsyncEventQueue
|
||||
|
||||
def test_async_event_queue_put_get() -> None:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import os
|
||||
import pytest
|
||||
from typing import Any
|
||||
from datetime import datetime
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
import pytest
|
||||
from unittest.mock import MagicMock, patch
|
||||
from unittest.mock import patch
|
||||
import os
|
||||
import threading
|
||||
import time
|
||||
import json
|
||||
import requests
|
||||
import sys
|
||||
from typing import Any
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
from unittest.mock import MagicMock, patch
|
||||
from models import Ticket, Track, WorkerContext
|
||||
import ai_client
|
||||
import multi_agent_conductor
|
||||
|
||||
# These tests define the expected interface for multi_agent_conductor.py
|
||||
# which will be implemented in the next phase of TDD.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import unittest
|
||||
from unittest.mock import MagicMock, patch
|
||||
from unittest.mock import patch
|
||||
import conductor_tech_lead
|
||||
import pytest
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
from typing import Any
|
||||
import pytest
|
||||
import os
|
||||
import tomllib
|
||||
import tomli_w
|
||||
from pathlib import Path
|
||||
import sys
|
||||
|
||||
# Ensure project root is in path
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import pytest
|
||||
from unittest.mock import patch, MagicMock
|
||||
import ai_client
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import pytest
|
||||
from models import Ticket
|
||||
from dag_engine import TrackDAG, ExecutionEngine
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ from typing import Any
|
||||
from unittest.mock import patch, MagicMock
|
||||
import json
|
||||
import subprocess
|
||||
import io
|
||||
import sys
|
||||
import os
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import unittest
|
||||
from unittest.mock import patch, MagicMock, ANY
|
||||
from unittest.mock import patch, MagicMock
|
||||
import json
|
||||
import subprocess
|
||||
import io
|
||||
import sys
|
||||
import os
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import pytest
|
||||
import time
|
||||
import time
|
||||
import os
|
||||
import sys
|
||||
import requests
|
||||
import json
|
||||
from typing import Any
|
||||
from api_hook_client import ApiHookClient
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from typing import Any
|
||||
import pytest
|
||||
import time
|
||||
import os
|
||||
import sys
|
||||
@@ -23,7 +22,7 @@ def test_gemini_cli_full_integration(live_gui: Any) -> None:
|
||||
# For CI/testing we prefer mock
|
||||
mock_script = os.path.abspath("tests/mock_gemini_cli.py")
|
||||
cli_cmd = f'"{sys.executable}" "{mock_script}"'
|
||||
print(f"[TEST] Setting current_provider to gemini_cli")
|
||||
print("[TEST] Setting current_provider to gemini_cli")
|
||||
client.set_value("current_provider", "gemini_cli")
|
||||
print(f"[TEST] Setting gcli_path to {cli_cmd}")
|
||||
client.set_value("gcli_path", cli_cmd)
|
||||
@@ -64,7 +63,7 @@ def test_gemini_cli_full_integration(live_gui: Any) -> None:
|
||||
content = entry.get("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.")
|
||||
print("[TEST] Success! Found final message in history.")
|
||||
found_final = True
|
||||
break
|
||||
if found_final:
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from typing import Any
|
||||
import pytest
|
||||
from unittest.mock import patch, MagicMock
|
||||
from unittest.mock import patch
|
||||
import ai_client
|
||||
|
||||
@patch('ai_client.GeminiCliAdapter')
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import pytest
|
||||
import os
|
||||
import sys
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import pytest
|
||||
from unittest.mock import MagicMock, patch
|
||||
from unittest.mock import patch
|
||||
from typing import Generator
|
||||
from gui_2 import App
|
||||
import ai_client
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import pytest
|
||||
from typing import Any
|
||||
import time
|
||||
import json
|
||||
import os
|
||||
import uuid
|
||||
from pathlib import Path
|
||||
|
||||
@@ -68,7 +68,7 @@ def test_performance_parity() -> None:
|
||||
# Actually I'll use 0.15 for assertion and log the actual.
|
||||
fps_diff_pct = abs(gui_m["avg_fps"] - gui2_m["avg_fps"]) / gui_m["avg_fps"] if gui_m["avg_fps"] > 0 else 0
|
||||
cpu_diff_pct = abs(gui_m["avg_cpu"] - gui2_m["avg_cpu"]) / gui_m["avg_cpu"] if gui_m["avg_cpu"] > 0 else 0
|
||||
print(f"\n--- Performance Parity Results ---")
|
||||
print("\n--- Performance Parity Results ---")
|
||||
print(f"FPS Diff: {fps_diff_pct*100:.2f}%")
|
||||
print(f"CPU Diff: {cpu_diff_pct*100:.2f}%")
|
||||
# We follow the 5% requirement for FPS
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import pytest
|
||||
from unittest.mock import MagicMock, patch, AsyncMock
|
||||
import asyncio
|
||||
from unittest.mock import MagicMock, patch
|
||||
from gui_2 import App
|
||||
from events import UserRequestEvent
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ def test_diagnostics_panel_updates(app_instance: Any) -> None:
|
||||
app_instance.perf_monitor.get_metrics = MagicMock(return_value=mock_metrics)
|
||||
with patch('dearpygui.dearpygui.is_item_shown', return_value=True), \
|
||||
patch('dearpygui.dearpygui.set_value') as mock_set_value, \
|
||||
patch('dearpygui.dearpygui.configure_item') as mock_configure_item, \
|
||||
patch('dearpygui.dearpygui.configure_item'), \
|
||||
patch('dearpygui.dearpygui.does_item_exist', return_value=True):
|
||||
# We also need to mock ai_client stats
|
||||
with patch('ai_client.get_history_bleed_stats', return_value={}):
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
|
||||
import pytest
|
||||
from unittest.mock import MagicMock, patch
|
||||
from unittest.mock import patch
|
||||
from typing import Generator
|
||||
import dearpygui.dearpygui as dpg
|
||||
import gui_legacy
|
||||
from gui_legacy import App
|
||||
import ai_client
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import pytest
|
||||
import time
|
||||
import sys
|
||||
import os
|
||||
@@ -36,7 +35,7 @@ def test_idle_performance_requirements(live_gui) -> None:
|
||||
assert frame_time < 33.3, f"Frame time {frame_time}ms exceeds 30fps threshold"
|
||||
|
||||
if valid_ft_count == 0 or total_ft == 0:
|
||||
print(f"[Warning] Frame time is 0.0. This is expected in headless CI/CD environments.")
|
||||
print("[Warning] Frame time is 0.0. This is expected in headless CI/CD environments.")
|
||||
print(f"[Test] Valid frame time samples: {valid_ft_count}/5")
|
||||
# In some CI environments without a real display, frame time might remain 0
|
||||
# but we've verified the hook is returning the dictionary.
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import os
|
||||
import shutil
|
||||
import json
|
||||
from pathlib import Path
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
import pytest
|
||||
from unittest.mock import MagicMock, patch
|
||||
from gui_2 import App
|
||||
from models import Track, Ticket
|
||||
import project_manager
|
||||
from models import Track
|
||||
|
||||
@pytest.fixture
|
||||
def mock_app() -> App:
|
||||
@@ -73,7 +72,7 @@ def test_add_ticket_logic(mock_app: App):
|
||||
assert t["assigned_to"] == "tier3-worker"
|
||||
|
||||
# Verify form was closed
|
||||
assert mock_app._show_add_ticket_form == False
|
||||
assert not mock_app._show_add_ticket_form
|
||||
# Verify push was called
|
||||
mock_push.assert_called_once()
|
||||
|
||||
@@ -140,7 +139,7 @@ def test_track_discussion_toggle(mock_app: App):
|
||||
|
||||
mock_app._render_discussion_panel()
|
||||
|
||||
assert mock_app._track_discussion_active == True
|
||||
assert mock_app._track_discussion_active
|
||||
mock_flush.assert_called()
|
||||
mock_load.assert_called_with("track-1", ".")
|
||||
assert len(mock_app.disc_entries) == 1
|
||||
@@ -158,7 +157,7 @@ def test_track_discussion_toggle(mock_app: App):
|
||||
|
||||
mock_app._render_discussion_panel()
|
||||
|
||||
assert mock_app._track_discussion_active == False
|
||||
assert not mock_app._track_discussion_active
|
||||
mock_switch.assert_called_with(mock_app.active_discussion)
|
||||
|
||||
def test_push_mma_state_update(mock_app: App):
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import pytest
|
||||
import asyncio
|
||||
from unittest.mock import patch, MagicMock
|
||||
from unittest.mock import patch
|
||||
from gui_2 import App
|
||||
import events
|
||||
|
||||
@pytest.fixture
|
||||
def app_instance():
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import pytest
|
||||
import time
|
||||
import sys
|
||||
import os
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import pytest
|
||||
from unittest.mock import patch, MagicMock
|
||||
from unittest.mock import patch
|
||||
import importlib.util
|
||||
import sys
|
||||
import os
|
||||
@@ -61,7 +61,7 @@ def test_telemetry_panel_updates_correctly(app_instance: Any) -> None:
|
||||
patch('dearpygui.dearpygui.set_value') as mock_set_value, \
|
||||
patch('dearpygui.dearpygui.configure_item') as mock_configure_item, \
|
||||
patch('dearpygui.dearpygui.is_item_shown', return_value=False), \
|
||||
patch('dearpygui.dearpygui.does_item_exist', return_value=True) as mock_does_item_exist:
|
||||
patch('dearpygui.dearpygui.does_item_exist', return_value=True):
|
||||
# 4. Call the method under test
|
||||
app_instance._refresh_api_metrics()
|
||||
# 5. Assert the results
|
||||
@@ -88,11 +88,11 @@ def test_cache_data_display_updates_correctly(app_instance: Any) -> None:
|
||||
expected_text = "Gemini Caches: 5 (12.1 KB)"
|
||||
# 3. Patch dependencies
|
||||
app_instance._last_bleed_update_time = 0 # Force update
|
||||
with patch('ai_client.get_gemini_cache_stats', return_value=mock_cache_stats) as mock_get_cache_stats, \
|
||||
with patch('ai_client.get_gemini_cache_stats', return_value=mock_cache_stats), \
|
||||
patch('dearpygui.dearpygui.set_value') as mock_set_value, \
|
||||
patch('dearpygui.dearpygui.configure_item') as mock_configure_item, \
|
||||
patch('dearpygui.dearpygui.is_item_shown', return_value=False), \
|
||||
patch('dearpygui.dearpygui.does_item_exist', return_value=True) as mock_does_item_exist:
|
||||
patch('dearpygui.dearpygui.does_item_exist', return_value=True):
|
||||
# We also need to mock get_history_bleed_stats as it's called in the same function
|
||||
with patch('ai_client.get_history_bleed_stats', return_value={}):
|
||||
# 4. Call the method under test with payload
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
from typing import Any
|
||||
import pytest
|
||||
from unittest.mock import MagicMock, patch, call
|
||||
from models import Ticket, Track, WorkerContext
|
||||
from unittest.mock import MagicMock, patch
|
||||
from models import Ticket, Track
|
||||
import multi_agent_conductor
|
||||
from multi_agent_conductor import ConductorEngine
|
||||
import ai_client
|
||||
import json
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_headless_verification_full_run(vlogger) -> None:
|
||||
@@ -121,7 +119,7 @@ async def test_headless_verification_error_and_qa_interceptor(vlogger) -> None:
|
||||
vlogger.log_state("T1 Initial Status", "todo", t1.status)
|
||||
|
||||
# Patch engine used in test
|
||||
with patch("multi_agent_conductor.run_worker_lifecycle", wraps=multi_agent_conductor.run_worker_lifecycle) as mock_worker_wrap:
|
||||
with patch("multi_agent_conductor.run_worker_lifecycle", wraps=multi_agent_conductor.run_worker_lifecycle):
|
||||
await engine.run()
|
||||
|
||||
vlogger.log_state("T1 Final Status", "todo", t1.status)
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import pytest
|
||||
import sys
|
||||
import os
|
||||
import tomli_w
|
||||
import tomllib
|
||||
from pathlib import Path
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
# Ensure project root is in path for imports
|
||||
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
||||
@@ -23,7 +21,7 @@ def test_aggregate_includes_segregated_history(tmp_path: Path) -> None:
|
||||
when it's segregated into a separate file.
|
||||
"""
|
||||
proj_path = tmp_path / "manual_slop.toml"
|
||||
hist_path = tmp_path / "manual_slop_history.toml"
|
||||
tmp_path / "manual_slop_history.toml"
|
||||
# Setup segregated project configuration
|
||||
proj_data = project_manager.default_project("test-aggregate")
|
||||
proj_data["discussion"]["discussions"]["main"]["history"] = ["@2026-02-24T14:00:00\nUser:\nShow me history"]
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
import os
|
||||
import sys
|
||||
import pytest
|
||||
import requests
|
||||
import json
|
||||
from unittest.mock import patch
|
||||
|
||||
# Ensure project root is in path
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
from typing import Generator
|
||||
import pytest
|
||||
from unittest.mock import MagicMock, patch, AsyncMock, ANY
|
||||
from unittest.mock import patch, ANY
|
||||
import asyncio
|
||||
import time
|
||||
from gui_2 import App
|
||||
from events import UserRequestEvent
|
||||
import ai_client
|
||||
|
||||
@pytest.fixture
|
||||
def mock_app() -> Generator[App, None, None]:
|
||||
@@ -94,7 +93,7 @@ def test_user_request_error_handling(mock_app: App) -> None:
|
||||
"""
|
||||
app = mock_app
|
||||
with (
|
||||
patch('ai_client.send', side_effect=Exception("API Failure")) as mock_send,
|
||||
patch('ai_client.send', side_effect=Exception("API Failure")),
|
||||
patch('ai_client.set_custom_system_prompt'),
|
||||
patch('ai_client.set_model_params'),
|
||||
patch('ai_client.set_agent_tools')
|
||||
|
||||
@@ -46,12 +46,10 @@ def test_full_live_workflow(live_gui) -> None:
|
||||
client.set_value("ai_input", "Hello! This is an automated test. Just say 'Acknowledged'.")
|
||||
client.click("btn_gen_send")
|
||||
time.sleep(2) # Verify thinking indicator appears (might be brief)
|
||||
thinking_seen = False
|
||||
print("\nPolling for thinking indicator...")
|
||||
for i in range(40):
|
||||
state = client.get_indicator_state("thinking_indicator")
|
||||
if state.get('shown'):
|
||||
thinking_seen = True
|
||||
print(f"Thinking indicator seen at poll {i}")
|
||||
break
|
||||
time.sleep(0.5)
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import pytest
|
||||
from unittest.mock import MagicMock, patch
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
# We can safely import gui_2 if we don't instantiate App without mocking its threads
|
||||
import gui_2
|
||||
from gui_2 import App
|
||||
|
||||
@pytest.fixture
|
||||
@@ -69,8 +67,8 @@ def test_render_log_management_logic(app_instance: App) -> None:
|
||||
patch("gui_2.imgui.begin") as mock_begin, \
|
||||
patch("gui_2.imgui.begin_table") as mock_begin_table, \
|
||||
patch("gui_2.imgui.text") as mock_text, \
|
||||
patch("gui_2.imgui.end_table") as mock_end_table, \
|
||||
patch("gui_2.imgui.end") as mock_end, \
|
||||
patch("gui_2.imgui.end_table"), \
|
||||
patch("gui_2.imgui.end"), \
|
||||
patch("gui_2.imgui.push_style_color"), \
|
||||
patch("gui_2.imgui.pop_style_color"), \
|
||||
patch("gui_2.imgui.table_setup_column"), \
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
from typing import Tuple
|
||||
import os
|
||||
import shutil
|
||||
import pytest
|
||||
from pathlib import Path
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
import os
|
||||
import shutil
|
||||
import pytest
|
||||
from typing import Any
|
||||
from pathlib import Path
|
||||
from datetime import datetime, timedelta
|
||||
from unittest.mock import patch
|
||||
import session_logger
|
||||
import tomllib
|
||||
from log_registry import LogRegistry
|
||||
from log_pruner import LogPruner
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import pytest
|
||||
import sys
|
||||
import os
|
||||
from unittest.mock import MagicMock, patch
|
||||
from unittest.mock import patch
|
||||
|
||||
# Ensure project root is in path
|
||||
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
from __future__ import annotations
|
||||
import math
|
||||
import pytest
|
||||
from unittest.mock import patch, MagicMock, call
|
||||
from unittest.mock import patch, MagicMock
|
||||
|
||||
from gui_2 import App
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from __future__ import annotations
|
||||
import pytest
|
||||
from unittest.mock import patch, MagicMock
|
||||
|
||||
from gui_2 import App
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import pytest
|
||||
from models import Ticket, Track, WorkerContext
|
||||
|
||||
def test_ticket_instantiation() -> None:
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import pytest
|
||||
import json
|
||||
from unittest.mock import patch, MagicMock
|
||||
import threading
|
||||
from unittest.mock import patch
|
||||
import time
|
||||
from gui_2 import App
|
||||
|
||||
@@ -56,8 +55,7 @@ def test_cb_plan_epic_launches_thread(app_instance: App) -> None:
|
||||
with (
|
||||
patch('orchestrator_pm.get_track_history_summary', return_value="History summary") as mock_get_history,
|
||||
patch('orchestrator_pm.generate_tracks', return_value=mock_tracks) as mock_gen_tracks,
|
||||
patch('aggregate.build_file_items', return_value=[]) as mock_build_files
|
||||
):
|
||||
patch('aggregate.build_file_items', return_value=[])):
|
||||
# We need to mock project_manager.flat_config and project_manager.load_project
|
||||
with (
|
||||
patch('project_manager.load_project', return_value={}),
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import pytest
|
||||
from mma_prompts import PROMPTS
|
||||
|
||||
def test_tier1_epic_init_constraints() -> None:
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from typing import Generator
|
||||
import pytest
|
||||
from unittest.mock import patch, MagicMock
|
||||
import asyncio
|
||||
from gui_2 import App
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import subprocess
|
||||
import json
|
||||
import pytest
|
||||
|
||||
|
||||
def get_message_content(stdout):
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import pytest
|
||||
from unittest.mock import MagicMock, patch
|
||||
from unittest.mock import patch
|
||||
import json
|
||||
from typing import Any
|
||||
import orchestrator_pm
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import unittest
|
||||
from typing import Any
|
||||
from unittest.mock import patch, MagicMock
|
||||
from unittest.mock import patch
|
||||
import json
|
||||
import orchestrator_pm
|
||||
import mma_prompts
|
||||
@@ -32,7 +32,7 @@ class TestOrchestratorPM(unittest.TestCase):
|
||||
# Verify summarize call
|
||||
mock_summarize.assert_called_once_with(file_items)
|
||||
# Verify ai_client.send call
|
||||
expected_system_prompt = mma_prompts.PROMPTS['tier1_epic_init']
|
||||
mma_prompts.PROMPTS['tier1_epic_init']
|
||||
mock_send.assert_called_once()
|
||||
args, kwargs = mock_send.call_args
|
||||
self.assertEqual(kwargs['md_content'], "")
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import unittest
|
||||
from unittest.mock import patch, MagicMock
|
||||
import os
|
||||
import shutil
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import pytest
|
||||
import sys
|
||||
import os
|
||||
import time
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
import pytest
|
||||
from unittest.mock import MagicMock, patch, AsyncMock
|
||||
import asyncio
|
||||
import json
|
||||
import multi_agent_conductor
|
||||
from multi_agent_conductor import ConductorEngine, run_worker_lifecycle
|
||||
from models import Ticket, Track, WorkerContext
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from typing import Generator
|
||||
import pytest
|
||||
from unittest.mock import MagicMock, patch
|
||||
from unittest.mock import patch
|
||||
import ai_client
|
||||
from gui_2 import App
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import pytest
|
||||
from typing import Any
|
||||
import json
|
||||
from pathlib import Path
|
||||
from project_manager import get_all_tracks, save_track_state
|
||||
from models import TrackState, Metadata, Ticket
|
||||
from datetime import datetime
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
import pytest
|
||||
import shutil
|
||||
import os
|
||||
import tomllib
|
||||
from pathlib import Path
|
||||
from datetime import datetime
|
||||
from unittest.mock import patch
|
||||
from typing import Generator
|
||||
import session_logger
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import pytest
|
||||
from unittest.mock import MagicMock, patch
|
||||
import os
|
||||
import sys
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import pytest
|
||||
from unittest.mock import MagicMock, patch
|
||||
import os
|
||||
import sys
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import pytest
|
||||
from unittest.mock import MagicMock, patch
|
||||
import os
|
||||
import sys
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import pytest
|
||||
from unittest.mock import MagicMock, patch
|
||||
import os
|
||||
import sys
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import pytest
|
||||
from unittest.mock import MagicMock, patch
|
||||
import os
|
||||
import sys
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import threading
|
||||
import time
|
||||
import requests
|
||||
import pytest
|
||||
from api_hook_client import ApiHookClient
|
||||
|
||||
def test_api_ask_client_method(live_gui) -> None:
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import pytest
|
||||
from unittest.mock import MagicMock, patch
|
||||
import subprocess
|
||||
from shell_runner import run_powershell
|
||||
|
||||
def test_run_powershell_qa_callback_on_failure(vlogger) -> None:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import pytest
|
||||
from typing import Any
|
||||
from pathlib import Path
|
||||
from aggregate import build_tier1_context, build_tier2_context, build_tier3_context
|
||||
@@ -24,8 +23,6 @@ def test_build_tier2_context_exists() -> None:
|
||||
|
||||
def test_build_tier3_context_ast_skeleton(monkeypatch: Any) -> None:
|
||||
from unittest.mock import MagicMock
|
||||
import aggregate
|
||||
import file_cache
|
||||
# Mock ASTParser
|
||||
mock_parser_instance = MagicMock()
|
||||
mock_parser_instance.get_skeleton.return_value = "def other():\n ..."
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import pytest
|
||||
import sys
|
||||
import os
|
||||
|
||||
@@ -10,6 +9,5 @@ import ai_client
|
||||
def test_token_usage_tracking() -> None:
|
||||
ai_client.reset_session()
|
||||
# Mock an API response with token usage
|
||||
usage = {"prompt_tokens": 100, "candidates_tokens": 50, "total_tokens": 150}
|
||||
# This would test the internal accumulator in ai_client
|
||||
pass
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
import pytest
|
||||
from pathlib import Path
|
||||
from datetime import datetime
|
||||
import os
|
||||
|
||||
# Import the real models
|
||||
from models import TrackState, Metadata, Ticket
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import pytest
|
||||
from datetime import datetime, timezone, timedelta
|
||||
|
||||
# Import necessary classes from models.py
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import pytest
|
||||
import sys
|
||||
import os
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import pytest
|
||||
|
||||
def test_vlogger_available(vlogger):
|
||||
vlogger.log_state("Test", "Before", "After")
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import pytest
|
||||
import sys
|
||||
import os
|
||||
from unittest.mock import MagicMock, patch
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
# Ensure project root is in path
|
||||
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
||||
|
||||
@@ -2,7 +2,6 @@ import subprocess
|
||||
import time
|
||||
import sys
|
||||
import os
|
||||
import glob
|
||||
|
||||
# --- Configuration ---
|
||||
GUI_SCRIPT = 'gui_2.py'
|
||||
|
||||
@@ -2,7 +2,6 @@ import pytest
|
||||
import time
|
||||
import sys
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
# Ensure project root is in path
|
||||
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
||||
|
||||
Reference in New Issue
Block a user