refactor(tests): Add strict type hints to fourth batch of test files
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
from typing import Generator
|
||||
import pytest
|
||||
from unittest.mock import MagicMock, patch
|
||||
import ai_client
|
||||
from gui_2 import App
|
||||
|
||||
@pytest.fixture
|
||||
def app_instance() -> None:
|
||||
def app_instance() -> Generator[App, None, None]:
|
||||
with (
|
||||
patch('gui_2.load_config', return_value={'ai': {'provider': 'gemini', 'model': 'gemini-2.5-flash-lite'}, 'projects': {}}),
|
||||
patch('gui_2.save_config'),
|
||||
@@ -21,8 +22,7 @@ def app_instance() -> None:
|
||||
app = App()
|
||||
yield app
|
||||
|
||||
def test_redundant_calls_in_process_pending_gui_tasks(app_instance):
|
||||
# Setup
|
||||
def test_redundant_calls_in_process_pending_gui_tasks(app_instance: App) -> None:
|
||||
app_instance._pending_gui_tasks = [
|
||||
{'action': 'set_value', 'item': 'current_provider', 'value': 'anthropic'}
|
||||
]
|
||||
@@ -40,8 +40,7 @@ def test_redundant_calls_in_process_pending_gui_tasks(app_instance):
|
||||
assert mock_set_provider.call_count == 1
|
||||
assert mock_reset_session.call_count == 1
|
||||
|
||||
def test_gcli_path_updates_adapter(app_instance):
|
||||
# Setup
|
||||
def test_gcli_path_updates_adapter(app_instance: App) -> None:
|
||||
app_instance.current_provider = 'gemini_cli'
|
||||
app_instance._pending_gui_tasks = [
|
||||
{'action': 'set_value', 'item': 'gcli_path', 'value': '/new/path/to/gemini'}
|
||||
|
||||
Reference in New Issue
Block a user