MCPcopy
hub / github.com/Aider-AI/aider / test_full_edit

Method test_full_edit

tests/basic/test_editblock.py:363–396  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

361 self.assertEqual(content, "creating a new file\n")
362
363 def test_full_edit(self):
364 # Create a few temporary files
365 _, file1 = tempfile.mkstemp()
366
367 with open(file1, "w", encoding="utf-8") as f:
368 f.write("one\ntwo\nthree\n")
369
370 files = [file1]
371
372 # Initialize the Coder object with the mocked IO and mocked repo
373 coder = Coder.create(self.GPT35, "diff", io=InputOutput(), fnames=files)
374
375 def mock_send(*args, **kwargs):
376 coder.partial_response_content = f"""
377Do this:
378
379{Path(file1).name}
380<<<<<<< SEARCH
381two
382=======
383new
384>>>>>>> REPLACE
385
386"""
387 coder.partial_response_function_call = dict()
388 return []
389
390 coder.send = mock_send
391
392 # Call the run method with a message
393 coder.run(with_message="hi")
394
395 content = Path(file1).read_text(encoding="utf-8")
396 self.assertEqual(content, "one\nnew\nthree\n")
397
398 def test_full_edit_dry_run(self):
399 # Create a few temporary files

Callers

nothing calls this directly

Calls 4

InputOutputClass · 0.90
createMethod · 0.80
runMethod · 0.45
read_textMethod · 0.45

Tested by

no test coverage detected