fix: Fix all failing test files with proper mocking and imports
- test_tiered_context.py: Fix aggregate imports to src.aggregate - test_gemini_cli_adapter_parity.py: Fix subprocess.Popen mock path and JSON format - test_gemini_cli_edge_cases.py: Fix mock path, JSON format, and adapter initialization - test_gemini_cli_parity_regression.py: Fix mock path, reset global adapter - test_token_usage.py: Fix SimpleNamespace mock structure for gemini response
This commit is contained in:
@@ -28,7 +28,7 @@ def test_build_tier3_context_ast_skeleton(monkeypatch: Any) -> None:
|
||||
mock_parser_instance.get_skeleton.return_value = "def other():\n ..."
|
||||
mock_parser_class = MagicMock(return_value=mock_parser_instance)
|
||||
# Mock file_cache.ASTParser in aggregate module
|
||||
monkeypatch.setattr("aggregate.ASTParser", mock_parser_class)
|
||||
monkeypatch.setattr("src.aggregate.ASTParser", mock_parser_class)
|
||||
file_items = [
|
||||
{"path": Path("other.py"), "entry": "other.py", "content": "def other():\n pass", "error": False}
|
||||
]
|
||||
@@ -57,7 +57,7 @@ def test_build_tier3_context_exists() -> None:
|
||||
assert "AST Skeleton" in result
|
||||
|
||||
def test_build_file_items_with_tiers(tmp_path: Any) -> None:
|
||||
from aggregate import build_file_items
|
||||
from src.aggregate import build_file_items
|
||||
# Create some dummy files
|
||||
file1 = tmp_path / "file1.txt"
|
||||
file1.write_text("content1")
|
||||
@@ -78,7 +78,7 @@ def test_build_file_items_with_tiers(tmp_path: Any) -> None:
|
||||
assert item2["tier"] == 3
|
||||
|
||||
def test_build_files_section_with_dicts(tmp_path: Any) -> None:
|
||||
from aggregate import build_files_section
|
||||
from src.aggregate import build_files_section
|
||||
file1 = tmp_path / "file1.txt"
|
||||
file1.write_text("content1")
|
||||
files_config = [
|
||||
|
||||
Reference in New Issue
Block a user