This commit is contained in:
2026-03-05 17:13:59 -05:00
parent d4923c5198
commit fd36aad539
11 changed files with 48 additions and 48 deletions

View File

@@ -24,7 +24,7 @@ def test_telemetry_data_updates_correctly(app_instance: Any) -> None:
"percentage": 75.0,
}
# 3. Patch the dependencies
with patch('ai_client.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
@@ -41,7 +41,7 @@ def test_performance_history_updates(app_instance: Any) -> None:
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('ai_client.get_token_stats', return_value=mock_stats):
with patch('src.ai_client.get_token_stats', return_value=mock_stats):
app_instance._on_api_event(payload={"text": "test"})
app_instance._process_pending_gui_tasks()
assert app_instance._token_stats["percentage"] == 50.0