mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 06:15:00 +00:00
fix: Add mock hash object to resolve NoneType hexdigest error in test
This commit is contained in:
parent
54ef8a1e19
commit
c8c5cbf8cc
1 changed files with 5 additions and 1 deletions
|
@ -29,8 +29,12 @@ class TestReasoning(unittest.TestCase):
|
|||
|
||||
mock_completion = MockCompletion(main_content, reasoning_content)
|
||||
|
||||
# Create a mock hash object
|
||||
mock_hash = MagicMock()
|
||||
mock_hash.hexdigest.return_value = "mock_hash_digest"
|
||||
|
||||
# Mock the model's send_completion method to return the expected tuple format
|
||||
with patch.object(model, "send_completion", return_value=(None, mock_completion)):
|
||||
with patch.object(model, "send_completion", return_value=(mock_hash, mock_completion)):
|
||||
# Call send with a simple message
|
||||
messages = [{"role": "user", "content": "test prompt"}]
|
||||
list(coder.send(messages))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue