mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 14:55:00 +00:00
style: Fix linting issues in test_reasoning.py
This commit is contained in:
parent
0df959cf68
commit
84f610c0e9
1 changed files with 8 additions and 4 deletions
|
@ -90,7 +90,9 @@ class TestReasoning(unittest.TestCase):
|
||||||
|
|
||||||
# Mock streaming response chunks
|
# Mock streaming response chunks
|
||||||
class MockStreamingChunk:
|
class MockStreamingChunk:
|
||||||
def __init__(self, content=None, reasoning_content=None, reasoning=None, finish_reason=None):
|
def __init__(
|
||||||
|
self, content=None, reasoning_content=None, reasoning=None, finish_reason=None
|
||||||
|
):
|
||||||
self.choices = [MagicMock()]
|
self.choices = [MagicMock()]
|
||||||
self.choices[0].delta = MagicMock()
|
self.choices[0].delta = MagicMock()
|
||||||
self.choices[0].finish_reason = finish_reason
|
self.choices[0].finish_reason = finish_reason
|
||||||
|
@ -108,7 +110,7 @@ class TestReasoning(unittest.TestCase):
|
||||||
else:
|
else:
|
||||||
# Need to handle attribute access that would raise AttributeError
|
# Need to handle attribute access that would raise AttributeError
|
||||||
delattr(self.choices[0].delta, "reasoning_content")
|
delattr(self.choices[0].delta, "reasoning_content")
|
||||||
|
|
||||||
# Set reasoning if provided
|
# Set reasoning if provided
|
||||||
if reasoning is not None:
|
if reasoning is not None:
|
||||||
self.choices[0].delta.reasoning = reasoning
|
self.choices[0].delta.reasoning = reasoning
|
||||||
|
@ -271,7 +273,9 @@ class TestReasoning(unittest.TestCase):
|
||||||
|
|
||||||
# Mock streaming response chunks
|
# Mock streaming response chunks
|
||||||
class MockStreamingChunk:
|
class MockStreamingChunk:
|
||||||
def __init__(self, content=None, reasoning_content=None, reasoning=None, finish_reason=None):
|
def __init__(
|
||||||
|
self, content=None, reasoning_content=None, reasoning=None, finish_reason=None
|
||||||
|
):
|
||||||
self.choices = [MagicMock()]
|
self.choices = [MagicMock()]
|
||||||
self.choices[0].delta = MagicMock()
|
self.choices[0].delta = MagicMock()
|
||||||
self.choices[0].finish_reason = finish_reason
|
self.choices[0].finish_reason = finish_reason
|
||||||
|
@ -289,7 +293,7 @@ class TestReasoning(unittest.TestCase):
|
||||||
else:
|
else:
|
||||||
# Need to handle attribute access that would raise AttributeError
|
# Need to handle attribute access that would raise AttributeError
|
||||||
delattr(self.choices[0].delta, "reasoning_content")
|
delattr(self.choices[0].delta, "reasoning_content")
|
||||||
|
|
||||||
# Set reasoning if provided
|
# Set reasoning if provided
|
||||||
if reasoning is not None:
|
if reasoning is not None:
|
||||||
self.choices[0].delta.reasoning = reasoning
|
self.choices[0].delta.reasoning = reasoning
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue