Updated tests and additional tests for folder expansion during conversation tracking

This commit is contained in:
Fahad
2025-06-15 16:03:43 +04:00
parent d36a85a3f3
commit 07a078b4f2
12 changed files with 317 additions and 26 deletions

View File

@@ -256,7 +256,10 @@ class TestPrecommitTool:
# Mock the centralized file preparation method
with patch.object(tool, "_prepare_file_content_for_prompt") as mock_prepare_files:
mock_prepare_files.return_value = "=== FILE: config.py ===\nCONFIG_VALUE = 42\n=== END FILE ==="
mock_prepare_files.return_value = (
"=== FILE: config.py ===\nCONFIG_VALUE = 42\n=== END FILE ===",
["/test/path/config.py"],
)
request = PrecommitRequest(
path="/absolute/repo/path",
@@ -320,7 +323,7 @@ class TestPrecommitTool:
# Mock the centralized file preparation method to return empty (file not found)
with patch.object(tool, "_prepare_file_content_for_prompt") as mock_prepare_files:
mock_prepare_files.return_value = ""
mock_prepare_files.return_value = ("", [])
result_with_files = await tool.prepare_prompt(request_with_files)
assert "If you need additional context files" not in result_with_files