refactor(tests): Add strict type hints to first batch of test files

This commit is contained in:
2026-02-28 19:06:50 -05:00
parent e8833b6656
commit f0415a40aa
10 changed files with 59 additions and 70 deletions

View File

@@ -7,12 +7,11 @@ import asyncio
import concurrent.futures
class MockDialog:
def __init__(self, approved, final_payload=None):
def __init__(self, approved: bool, final_payload: dict | None = None) -> None:
self.approved = approved
self.final_payload = final_payload
def wait(self):
# Match the new return format: a dictionary
def wait(self) -> dict:
res = {'approved': self.approved, 'abort': False}
if self.final_payload:
res.update(self.final_payload)
@@ -25,7 +24,7 @@ def mock_ai_client() -> None:
yield mock_send
@pytest.mark.asyncio
async def test_confirm_spawn_pushed_to_queue():
async def test_confirm_spawn_pushed_to_queue() -> None:
event_queue = events.AsyncEventQueue()
ticket_id = "T1"
role = "Tier 3 Worker"
@@ -54,7 +53,7 @@ async def test_confirm_spawn_pushed_to_queue():
assert final_context == "Modified Context"
@patch("multi_agent_conductor.confirm_spawn")
def test_run_worker_lifecycle_approved(mock_confirm, mock_ai_client):
def test_run_worker_lifecycle_approved(mock_confirm: MagicMock, mock_ai_client: MagicMock) -> None:
ticket = Ticket(id="T1", description="desc", status="todo", assigned_to="user")
context = WorkerContext(ticket_id="T1", model_name="model", messages=[])
event_queue = events.AsyncEventQueue()
@@ -68,7 +67,7 @@ def test_run_worker_lifecycle_approved(mock_confirm, mock_ai_client):
assert ticket.status == "completed"
@patch("multi_agent_conductor.confirm_spawn")
def test_run_worker_lifecycle_rejected(mock_confirm, mock_ai_client):
def test_run_worker_lifecycle_rejected(mock_confirm: MagicMock, mock_ai_client: MagicMock) -> None:
ticket = Ticket(id="T1", description="desc", status="todo", assigned_to="user")
context = WorkerContext(ticket_id="T1", model_name="model", messages=[])
event_queue = events.AsyncEventQueue()