Private
Public Access
test: remove gemini_cli references in 6 + delete test_ai_client_list_models.py
Drop stale gemini_cli expectations: PROVIDERS expectations in test_providers_source_of_truth + test_provider_curation, the test_list_models_gemini_cli function (deleted the whole file since it was the only test), the test_discussion_compression_gemini_cli function, the test_gcli_path_updates_adapter function (its setter was removed), the ui_gemini_cli_path references in test_mma_tier_usage_reset_fix and test_rag_integration. These are the t1.9 minor edits.
This commit is contained in:
@@ -1,17 +0,0 @@
|
|||||||
from src import ai_client
|
|
||||||
|
|
||||||
def test_list_models_gemini_cli() -> None:
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
Verifies that 'ai_client.list_models' correctly returns a list of models
|
|
||||||
for the 'gemini_cli' provider.
|
|
||||||
"""
|
|
||||||
models = ai_client.list_models("gemini_cli")
|
|
||||||
assert "gemini-3.1-pro-preview" in models
|
|
||||||
assert "gemini-3-flash-preview" in models
|
|
||||||
assert "gemini-2.5-pro" in models
|
|
||||||
assert "gemini-2.5-flash" in models
|
|
||||||
assert "gemini-2.0-flash" in models
|
|
||||||
assert "gemini-2.5-flash-lite" in models
|
|
||||||
assert len(models) == 6
|
|
||||||
@@ -64,11 +64,7 @@ def test_discussion_compression_deepseek():
|
|||||||
|
|
||||||
assert result == "DeepSeek summary."
|
assert result == "DeepSeek summary."
|
||||||
|
|
||||||
def test_discussion_compression_gemini_cli():
|
|
||||||
ai_client.set_provider("gemini_cli", "gemini-1.5-flash")
|
|
||||||
|
|
||||||
mock_adapter = MagicMock()
|
|
||||||
mock_adapter.send.return_value = {"text": "CLI summary."}
|
|
||||||
|
|
||||||
with patch("src.ai_client.GeminiCliAdapter", return_value=mock_adapter):
|
with patch("src.ai_client.GeminiCliAdapter", return_value=mock_adapter):
|
||||||
result = ai_client.run_discussion_compression("CLI history")
|
result = ai_client.run_discussion_compression("CLI history")
|
||||||
|
|||||||
@@ -34,12 +34,11 @@ def controller(tmp_path: Path) -> AppController:
|
|||||||
ctrl = AppController()
|
ctrl = AppController()
|
||||||
ctrl.active_project_path = str(proj_path)
|
ctrl.active_project_path = str(proj_path)
|
||||||
# _flush_to_project reads several UI flags that __init__ does not set
|
# _flush_to_project reads several UI flags that __init__ does not set
|
||||||
# (ui_project_preset_name, ui_word_wrap, ui_gemini_cli_path,
|
# (ui_project_preset_name, ui_word_wrap,
|
||||||
# ui_auto_add_history). Set them so the test exercises the
|
# ui_auto_add_history). Set them so the test exercises the
|
||||||
# mma_tier_usage code path without tripping on unrelated missing attrs.
|
# mma_tier_usage code path without tripping on unrelated missing attrs.
|
||||||
ctrl.ui_project_preset_name = None
|
ctrl.ui_project_preset_name = None
|
||||||
ctrl.ui_word_wrap = True
|
ctrl.ui_word_wrap = True
|
||||||
ctrl.ui_gemini_cli_path = ""
|
|
||||||
ctrl.ui_auto_add_history = False
|
ctrl.ui_auto_add_history = False
|
||||||
yield ctrl
|
yield ctrl
|
||||||
|
|
||||||
|
|||||||
@@ -36,16 +36,6 @@ def test_redundant_calls_in_process_pending_gui_tasks(app_instance: App) -> None
|
|||||||
assert mock_set_provider.call_count == 1
|
assert mock_set_provider.call_count == 1
|
||||||
assert mock_reset_session.call_count == 1
|
assert mock_reset_session.call_count == 1
|
||||||
|
|
||||||
def test_gcli_path_updates_adapter(app_instance: App) -> None:
|
|
||||||
app_instance.controller.current_provider = 'gemini_cli'
|
|
||||||
app_instance.controller._pending_gui_tasks = [
|
|
||||||
{'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._gemini_cli_adapter = None
|
|
||||||
app_instance.controller._process_pending_gui_tasks()
|
|
||||||
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:
|
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."""
|
"""Test that the drag action is correctly processed and dispatches to the registered callback."""
|
||||||
|
|||||||
@@ -3,6 +3,6 @@ import src.app_controller
|
|||||||
|
|
||||||
def test_providers_moved_to_models():
|
def test_providers_moved_to_models():
|
||||||
"""Verify that PROVIDERS list is in models.py and removed from AppController."""
|
"""Verify that PROVIDERS list is in models.py and removed from AppController."""
|
||||||
expected_providers = ['gemini', 'anthropic', 'gemini_cli', 'deepseek', 'minimax', 'qwen', 'grok', 'llama']
|
expected_providers = ['gemini', 'anthropic', 'deepseek', 'minimax', 'qwen', 'grok', 'llama']
|
||||||
assert models.PROVIDERS == expected_providers
|
assert models.PROVIDERS == expected_providers
|
||||||
assert not hasattr(src.app_controller.AppController, 'PROVIDERS')
|
assert not hasattr(src.app_controller.AppController, 'PROVIDERS')
|
||||||
@@ -9,7 +9,7 @@ from __future__ import annotations
|
|||||||
import src.models as models
|
import src.models as models
|
||||||
import src.ai_client as ai_client
|
import src.ai_client as ai_client
|
||||||
|
|
||||||
EXPECTED_PROVIDERS = ["gemini", "anthropic", "gemini_cli", "deepseek", "minimax", "qwen", "grok", "llama"]
|
EXPECTED_PROVIDERS = ["gemini", "anthropic", "deepseek", "minimax", "qwen", "grok", "llama"]
|
||||||
|
|
||||||
def test_providers_defined_in_src_ai_client() -> None:
|
def test_providers_defined_in_src_ai_client() -> None:
|
||||||
assert hasattr(ai_client, "PROVIDERS")
|
assert hasattr(ai_client, "PROVIDERS")
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ def test_rag_integration(mock_project):
|
|||||||
app.history_trunc_limit = 1000
|
app.history_trunc_limit = 1000
|
||||||
app.top_p = 1.0
|
app.top_p = 1.0
|
||||||
app.ui_agent_tools = {}
|
app.ui_agent_tools = {}
|
||||||
app.ui_gemini_cli_path = "gemini"
|
|
||||||
app.current_model = "gemini-1.5-flash"
|
app.current_model = "gemini-1.5-flash"
|
||||||
app.active_project_path = os.path.join(mock_project, "manual_slop.toml")
|
app.active_project_path = os.path.join(mock_project, "manual_slop.toml")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user