chore: apply ruff auto-fixes and remove dead AST scripts

This commit is contained in:
2026-03-02 13:26:20 -05:00
parent 54635d8d1c
commit b9686392d7
114 changed files with 79 additions and 953 deletions

View File

@@ -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: