remove(ai_client): delete unused stub and proxy files
Deleted: - src/ai_client_stub.py - src/ai_client_proxy.py Fixed test imports to use ai_client instead of ai_client_stub.
This commit is contained in:
@@ -88,7 +88,7 @@ def test_on_tool_log_offloading(app_controller, tmp_session_dir):
|
||||
script = "Get-Process"
|
||||
result = "Process list..."
|
||||
|
||||
with patch("src.ai_client_stub.get_current_tier", return_value="Tier 3"):
|
||||
with patch("src.ai_client.get_current_tier", return_value="Tier 3"):
|
||||
app_controller._on_tool_log(script, result)
|
||||
|
||||
# Verify files were created in session directory
|
||||
|
||||
@@ -17,8 +17,8 @@ def app_instance():
|
||||
patch('src.app_controller.AppController._prune_old_logs'),
|
||||
patch('src.app_controller.AppController.start_services'),
|
||||
patch('src.api_hooks.HookServer'),
|
||||
patch('src.ai_client_stub.set_provider'),
|
||||
patch('src.ai_client_stub.reset_session')
|
||||
patch('src.ai_client.set_provider'),
|
||||
patch('src.ai_client.reset_session')
|
||||
):
|
||||
app = App()
|
||||
app.project = {
|
||||
|
||||
@@ -31,7 +31,7 @@ def test_telemetry_data_updates_correctly(app_instance: Any) -> None:
|
||||
"percentage": 75.0,
|
||||
}
|
||||
# 3. Patch the dependencies
|
||||
with patch('src.ai_client_stub.get_token_stats', return_value=mock_stats) as mock_get_stats:
|
||||
with patch('src.ai_client.get_token_stats', return_value=mock_stats) as mock_get_stats:
|
||||
# 4. Call the method under test
|
||||
app_instance._refresh_api_metrics({}, md_content="test content")
|
||||
# 5. Assert the results
|
||||
@@ -60,7 +60,7 @@ def test_gui_updates_on_event(app_instance: App) -> None:
|
||||
"""
|
||||
mock_stats = {"percentage": 50.0, "current": 500, "limit": 1000}
|
||||
app_instance.last_md = "mock_md"
|
||||
with patch('src.ai_client_stub.get_token_stats', return_value=mock_stats):
|
||||
with patch('src.ai_client.get_token_stats', return_value=mock_stats):
|
||||
# Drain the queue
|
||||
while not app_instance.event_queue.empty():
|
||||
app_instance.event_queue.get()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from typing import Generator
|
||||
import pytest
|
||||
from unittest.mock import patch, Mock
|
||||
from src import ai_client_stub
|
||||
from src import ai_client
|
||||
from src.gui_2 import App
|
||||
|
||||
@pytest.fixture
|
||||
@@ -20,8 +20,8 @@ def app_instance() -> Generator[App, None, None]:
|
||||
patch('src.app_controller.AppController.start_services'),
|
||||
# Do not patch _init_ai_and_hooks to ensure _settable_fields is initialized
|
||||
patch('src.api_hooks.HookServer'),
|
||||
patch('src.ai_client_stub.set_provider'),
|
||||
patch('src.ai_client_stub.reset_session')
|
||||
patch('src.ai_client.set_provider'),
|
||||
patch('src.ai_client.reset_session')
|
||||
):
|
||||
app = App()
|
||||
yield app
|
||||
@@ -30,8 +30,8 @@ def test_redundant_calls_in_process_pending_gui_tasks(app_instance: App) -> None
|
||||
app_instance.controller._pending_gui_tasks = [
|
||||
{'action': 'set_value', 'item': 'current_provider', 'value': 'anthropic'}
|
||||
]
|
||||
with patch('src.ai_client_stub.set_provider') as mock_set_provider, \
|
||||
patch('src.ai_client_stub.reset_session') as mock_reset_session:
|
||||
with patch('src.ai_client.set_provider') as mock_set_provider, \
|
||||
patch('src.ai_client.reset_session') as mock_reset_session:
|
||||
app_instance.controller._process_pending_gui_tasks()
|
||||
assert mock_set_provider.call_count == 1
|
||||
assert mock_reset_session.call_count == 1
|
||||
@@ -42,10 +42,10 @@ def test_gcli_path_updates_adapter(app_instance: App) -> None:
|
||||
{'action': 'set_value', 'item': 'gcli_path', 'value': '/new/path/to/gemini'}
|
||||
]
|
||||
# Initialize adapter if it doesn't exist (it shouldn't in mock env)
|
||||
ai_client_stub._gemini_cli_adapter = None
|
||||
ai_client._gemini_cli_adapter = None
|
||||
app_instance.controller._process_pending_gui_tasks()
|
||||
assert ai_client_stub._gemini_cli_adapter is not None
|
||||
assert ai_client_stub._gemini_cli_adapter.binary_path == '/new/path/to/gemini'
|
||||
assert ai_client._gemini_cli_adapter is not None
|
||||
assert ai_client._gemini_cli_adapter.binary_path == '/new/path/to/gemini'
|
||||
|
||||
def test_process_pending_gui_tasks_drag(app_instance: App) -> None:
|
||||
"""Test that the drag action is correctly processed and dispatches to the registered callback."""
|
||||
|
||||
Reference in New Issue
Block a user