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

@@ -19,7 +19,7 @@ class TestOrchestratorPMHistory(unittest.TestCase):
if self.test_dir.exists():
shutil.rmtree(self.test_dir)
def create_track(self, parent_dir, track_id, title, status, overview):
def create_track(self, parent_dir: Path, track_id: str, title: str, status: str, overview: str) -> None:
track_path = parent_dir / track_id
track_path.mkdir(exist_ok=True)
metadata = {"title": title, "status": status}
@@ -30,8 +30,7 @@ class TestOrchestratorPMHistory(unittest.TestCase):
f.write(spec_content)
@patch('orchestrator_pm.CONDUCTOR_PATH', Path("test_conductor"))
def test_get_track_history_summary(self):
# Setup mock tracks
def test_get_track_history_summary(self) -> None:
self.create_track(self.archive_dir, "track_001", "Initial Setup", "completed", "Setting up the project structure.")
self.create_track(self.tracks_dir, "track_002", "Feature A", "in_progress", "Implementing Feature A.")
summary = orchestrator_pm.get_track_history_summary()
@@ -43,8 +42,7 @@ class TestOrchestratorPMHistory(unittest.TestCase):
self.assertIn("Implementing Feature A.", summary)
@patch('orchestrator_pm.CONDUCTOR_PATH', Path("test_conductor"))
def test_get_track_history_summary_missing_files(self):
# Track with missing spec.md
def test_get_track_history_summary_missing_files(self) -> None:
track_path = self.tracks_dir / "track_003"
track_path.mkdir(exist_ok=True)
with open(track_path / "metadata.json", "w") as f:
@@ -56,7 +54,7 @@ class TestOrchestratorPMHistory(unittest.TestCase):
@patch('orchestrator_pm.summarize.build_summary_markdown')
@patch('ai_client.send')
def test_generate_tracks_with_history(self, mock_send, mock_summarize):
def test_generate_tracks_with_history(self, mock_send: MagicMock, mock_summarize: MagicMock) -> None:
mock_summarize.return_value = "REPO_MAP"
mock_send.return_value = "[]"
history_summary = "PAST_HISTORY_SUMMARY"