mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-27 15:55:00 +00:00
style: Format code with linter and improve import sorting
This commit is contained in:
parent
2ffe49130d
commit
5f694f228f
1 changed files with 18 additions and 13 deletions
|
@ -4,7 +4,11 @@ from unittest.mock import MagicMock, patch
|
||||||
from aider.coders.base_coder import Coder
|
from aider.coders.base_coder import Coder
|
||||||
from aider.io import InputOutput
|
from aider.io import InputOutput
|
||||||
from aider.models import Model
|
from aider.models import Model
|
||||||
from aider.reasoning_tags import REASONING_TAG, format_reasoning_content, replace_reasoning_tags
|
from aider.reasoning_tags import (
|
||||||
|
REASONING_TAG,
|
||||||
|
format_reasoning_content,
|
||||||
|
replace_reasoning_tags,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class TestReasoning(unittest.TestCase):
|
class TestReasoning(unittest.TestCase):
|
||||||
|
@ -31,7 +35,7 @@ class TestReasoning(unittest.TestCase):
|
||||||
mock_completion = MockCompletion(main_content, reasoning_content)
|
mock_completion = MockCompletion(main_content, reasoning_content)
|
||||||
|
|
||||||
# Mock the model's send_completion method
|
# Mock the model's send_completion method
|
||||||
with patch.object(model, 'send_completion', return_value=mock_completion):
|
with patch.object(model, "send_completion", return_value=mock_completion):
|
||||||
# Call send with a simple message
|
# Call send with a simple message
|
||||||
messages = [{"role": "user", "content": "test prompt"}]
|
messages = [{"role": "user", "content": "test prompt"}]
|
||||||
coder.send(messages)
|
coder.send(messages)
|
||||||
|
@ -51,8 +55,9 @@ class TestReasoning(unittest.TestCase):
|
||||||
# Ensure proper order: reasoning first, then main content
|
# Ensure proper order: reasoning first, then main content
|
||||||
reasoning_pos = output.find(reasoning_content)
|
reasoning_pos = output.find(reasoning_content)
|
||||||
main_pos = output.find(main_content)
|
main_pos = output.find(main_content)
|
||||||
self.assertLess(reasoning_pos, main_pos,
|
self.assertLess(
|
||||||
"Reasoning content should appear before main content")
|
reasoning_pos, main_pos, "Reasoning content should appear before main content"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue