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

@@ -17,7 +17,7 @@ import ai_client
# --- Tests for Aggregate Module ---
def test_aggregate_includes_segregated_history(tmp_path):
def test_aggregate_includes_segregated_history(tmp_path: Path) -> None:
"""
Tests if the aggregate function correctly includes history
when it's segregated into a separate file.
@@ -38,7 +38,7 @@ def test_aggregate_includes_segregated_history(tmp_path):
assert "Show me history" in markdown
# --- Tests for MCP Client and Blacklisting ---
def test_mcp_blacklist(tmp_path):
def test_mcp_blacklist(tmp_path: Path) -> None:
"""
Tests that the MCP client correctly blacklists specified files
and prevents listing them.
@@ -57,7 +57,7 @@ def test_mcp_blacklist(tmp_path):
# The blacklisted file should not appear in the directory listing
assert "my_project_history.toml" not in result
def test_aggregate_blacklist(tmp_path):
def test_aggregate_blacklist(tmp_path: Path) -> None:
"""
Tests that aggregate's path resolution respects blacklisting,
ensuring history files are not included by default.
@@ -73,7 +73,7 @@ def test_aggregate_blacklist(tmp_path):
assert hist_file not in paths, "History file should be excluded even with a general glob"
# --- Tests for History Migration and Separation ---
def test_migration_on_load(tmp_path):
def test_migration_on_load(tmp_path: Path) -> None:
"""
Tests that project loading migrates discussion history from manual_slop.toml
to manual_slop_history.toml if it exists in the main config.
@@ -102,7 +102,7 @@ def test_migration_on_load(tmp_path):
on_disk_hist = tomllib.load(f)
assert on_disk_hist["discussions"]["main"]["history"] == ["Hello", "World"]
def test_save_separation(tmp_path):
def test_save_separation(tmp_path: Path) -> None:
"""
Tests that saving project data correctly separates discussion history
into manual_slop_history.toml.
@@ -128,7 +128,7 @@ def test_save_separation(tmp_path):
assert h_disk["discussions"]["main"]["history"] == ["Saved", "Separately"]
# --- Tests for History Persistence Across Turns ---
def test_history_persistence_across_turns(tmp_path):
def test_history_persistence_across_turns(tmp_path: Path) -> None:
"""
Tests that discussion history is correctly persisted across multiple save/load cycles.
"""