29 lines
1.5 KiB
Python
29 lines
1.5 KiB
Python
"""Default execution must preserve the full invocation without localization calls."""
|
|
|
|
from pathlib import Path
|
|
|
|
from band_aider.context.provenance import FutureGuidance
|
|
from band_aider.judgement.edit_request import AiderEditRequest
|
|
from band_aider.judgement.prompt_localization import PromptLocalization
|
|
from tests.band_aider_loop_impl import _file_manager
|
|
from tests.support.completion_clients import ScriptedCompletionClient
|
|
|
|
|
|
def test_disabled_localization_preserves_the_complete_prompt_without_model_calls() -> None:
|
|
"""Source, diagnostics, format and literal placeholders survive the real default path."""
|
|
manager = _file_manager(Path('/testbed'))
|
|
client = ScriptedCompletionClient(())
|
|
original = ('Goal: keep snapshots until exit.\r\n'
|
|
'FILE: src/foo.py\r\nSEARCH:\r\ndef foo():\r\n return 1\r\n'
|
|
'Failure: AssertionError: expected 2, got 1\r\n'
|
|
'Return FILE/SEARCH/REPLACE blocks; no markdown fences.\r\n'
|
|
'{{SOURCE}}\r\n')
|
|
future = FutureGuidance(origin_message_id='later', addressed_message_id='earlier',
|
|
message='Additional guidance', justification='Retain the existing applicability owner.')
|
|
request = AiderEditRequest('goal', [Path('src/foo.py')], [], future_guidance=(future,))
|
|
|
|
result = PromptLocalization(client=client, file_manager=manager, request=request,
|
|
owner='DirectCodeEditor').localize(original)
|
|
|
|
assert result == original
|
|
assert client.prompts == []
|