style: format code with linter

This commit is contained in:
Paul Gauthier (aider) 2024-08-29 13:02:54 -07:00
parent 5f3583d7f2
commit 3b9b789b2d

View file

@ -854,9 +854,23 @@ This command will print 'Hello, World!' to the console."""
# Set up some real done_messages and cur_messages # Set up some real done_messages and cur_messages
coder.done_messages = [ coder.done_messages = [
{"role": "user", "content": "Hello, can you help me with a Python problem?"}, {"role": "user", "content": "Hello, can you help me with a Python problem?"},
{"role": "assistant", "content": "Of course! I'd be happy to help. What's the problem you're facing?"}, {
{"role": "user", "content": "I need to write a function that calculates the factorial of a number."}, "role": "assistant",
{"role": "assistant", "content": "Sure, I can help you with that. Here's a simple Python function to calculate the factorial of a number:"}, "content": "Of course! I'd be happy to help. What's the problem you're facing?",
},
{
"role": "user",
"content": (
"I need to write a function that calculates the factorial of a number."
),
},
{
"role": "assistant",
"content": (
"Sure, I can help you with that. Here's a simple Python function to"
" calculate the factorial of a number:"
),
},
] ]
coder.cur_messages = [ coder.cur_messages = [
@ -869,7 +883,9 @@ This command will print 'Hello, World!' to the console."""
"max_input_tokens": 4000, "max_input_tokens": 4000,
"max_output_tokens": 1000, "max_output_tokens": 1000,
} }
coder.partial_response_content = "Here's an optimized version of the factorial function:" coder.partial_response_content = (
"Here's an optimized version of the factorial function:"
)
coder.io.tool_error = MagicMock() coder.io.tool_error = MagicMock()
# Call the method # Call the method
@ -885,5 +901,6 @@ This command will print 'Hello, World!' to the console."""
self.assertIn("Output tokens: ~1,000 of 1,000", error_message) self.assertIn("Output tokens: ~1,000 of 1,000", error_message)
self.assertIn("Total tokens: ~2,000 of 4,000", error_message) self.assertIn("Total tokens: ~2,000 of 4,000", error_message)
if __name__ == "__main__": if __name__ == "__main__":
unittest.main() unittest.main()