mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 22:34:59 +00:00
refactor: Consolidate subprocess.call mock in test_pipe_editor
This commit is contained in:
parent
14522dbbcd
commit
e63df83091
1 changed files with 14 additions and 14 deletions
|
@ -99,6 +99,7 @@ def test_pipe_editor():
|
||||||
patch("aider.editor.write_temp_file") as mock_write,
|
patch("aider.editor.write_temp_file") as mock_write,
|
||||||
patch("builtins.open") as mock_open,
|
patch("builtins.open") as mock_open,
|
||||||
patch("os.remove") as mock_remove,
|
patch("os.remove") as mock_remove,
|
||||||
|
patch("subprocess.call") as mock_subprocess,
|
||||||
):
|
):
|
||||||
# Setup mocks
|
# Setup mocks
|
||||||
mock_write.return_value = "temp.txt"
|
mock_write.return_value = "temp.txt"
|
||||||
|
@ -106,7 +107,6 @@ def test_pipe_editor():
|
||||||
mock_file.__enter__.return_value.read.return_value = modified_content
|
mock_file.__enter__.return_value.read.return_value = modified_content
|
||||||
mock_open.return_value = mock_file
|
mock_open.return_value = mock_file
|
||||||
|
|
||||||
with patch("subprocess.call") as mock_subprocess:
|
|
||||||
# Test with default editor
|
# Test with default editor
|
||||||
result = pipe_editor(test_content)
|
result = pipe_editor(test_content)
|
||||||
assert result == modified_content
|
assert result == modified_content
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue