refactor(aggregate): remove deprecated build_tier1_context and build_tier2_context
This commit is contained in:
@@ -1,25 +1,6 @@
|
||||
from typing import Any
|
||||
from pathlib import Path
|
||||
from src.aggregate import build_tier1_context, build_tier2_context, build_tier3_context
|
||||
|
||||
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}
|
||||
]
|
||||
history = ["User: hello", "AI: hi"]
|
||||
result = build_tier1_context(file_items, Path("."), [], history)
|
||||
assert "Product content" in result
|
||||
# other.py should be summarized, not full content in a code block
|
||||
assert "Other content" not in result or "Summarized" in result # Assuming summary format
|
||||
|
||||
def test_build_tier2_context_exists() -> None:
|
||||
file_items = [
|
||||
{"path": Path("other.py"), "entry": "other.py", "content": "Other content", "error": False}
|
||||
]
|
||||
history = ["User: hello"]
|
||||
result = build_tier2_context(file_items, Path("."), [], history)
|
||||
assert "Other content" in result
|
||||
from src.aggregate import build_tier3_context
|
||||
|
||||
def test_build_tier3_context_ast_skeleton(monkeypatch: Any) -> None:
|
||||
from unittest.mock import MagicMock
|
||||
@@ -94,14 +75,6 @@ def test_tiered_context_by_tier_field() -> None:
|
||||
{"path": Path("tier3_file.txt"), "entry": "tier3_file.txt", "content": "Full Tier 3 Content\nLine 2\nLine 3\nLine 4\nLine 5\nLine 6\nLine 7\nLine 8\nLine 9\nLine 10", "tier": 3},
|
||||
{"path": Path("other.txt"), "entry": "other.txt", "content": "Other Content\nLine 2\nLine 3\nLine 4\nLine 5\nLine 6\nLine 7\nLine 8\nLine 9\nLine 10", "tier": None}
|
||||
]
|
||||
# Test Tier 1 Context
|
||||
result_t1 = build_tier1_context(file_items, Path("."), [], [])
|
||||
assert "Full Tier 1 Content" in result_t1
|
||||
assert "Line 2" in result_t1 # In full
|
||||
# tier3_file.txt should be summarized
|
||||
assert "tier3_file.txt" in result_t1
|
||||
assert "preview:" in result_t1
|
||||
assert "Line 9" not in result_t1 # Only first 8 lines in preview
|
||||
# Test Tier 3 Context
|
||||
result_t3 = build_tier3_context(file_items, Path("."), [], [], focus_files=[])
|
||||
assert "Full Tier 3 Content" in result_t3
|
||||
|
||||
Reference in New Issue
Block a user