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

This commit is contained in:
2026-02-28 19:11:23 -05:00
parent f0415a40aa
commit 579ee8394f
10 changed files with 358 additions and 351 deletions

View File

@@ -1,9 +1,9 @@
import pytest
from typing import Any
from pathlib import Path
from aggregate import build_tier1_context, build_tier2_context, build_tier3_context
def test_build_tier1_context_exists():
# This should fail if the function is not defined
def test_build_tier1_context_exists() -> None:
file_items = [
{"path": Path("conductor/product.md"), "entry": "conductor/product.md", "content": "Product content", "error": False},
{"path": Path("other.py"), "entry": "other.py", "content": "Other content", "error": False}
@@ -22,7 +22,7 @@ def test_build_tier2_context_exists() -> None:
result = build_tier2_context(file_items, Path("."), [], history)
assert "Other content" in result
def test_build_tier3_context_ast_skeleton(monkeypatch):
def test_build_tier3_context_ast_skeleton(monkeypatch: Any) -> None:
from unittest.mock import MagicMock
import aggregate
import file_cache
@@ -59,7 +59,7 @@ def test_build_tier3_context_exists() -> None:
assert "other.py" in result
assert "AST Skeleton" in result
def test_build_file_items_with_tiers(tmp_path):
def test_build_file_items_with_tiers(tmp_path: Any) -> None:
from aggregate import build_file_items
# Create some dummy files
file1 = tmp_path / "file1.txt"
@@ -80,7 +80,7 @@ def test_build_file_items_with_tiers(tmp_path):
assert item2["content"] == "content2"
assert item2["tier"] == 3
def test_build_files_section_with_dicts(tmp_path):
def test_build_files_section_with_dicts(tmp_path: Any) -> None:
from aggregate import build_files_section
file1 = tmp_path / "file1.txt"
file1.write_text("content1")