chore: collapse multi-line argument definitions into single lines across multiple modules
This commit is contained in:
+3
-1
@@ -12,7 +12,9 @@ class TestApi(unittest.TestCase):
|
||||
def test_call_api_success(self, mock_slim, mock_urlopen):
|
||||
mock_slim.return_value = [{"role": "user", "content": "test"}]
|
||||
mock_response = MagicMock()
|
||||
mock_response.read.return_value = b'{"choices": [{"message": {"content": "response"}}], "usage": {"tokens": 10}}'
|
||||
mock_response.read.return_value = (
|
||||
b'{"choices": [{"message": {"content": "response"}}], "usage": {"tokens": 10}}'
|
||||
)
|
||||
mock_urlopen.return_value.__enter__.return_value = mock_response
|
||||
|
||||
result = call_api([], "model", "http://url", "key", True, [{"name": "tool"}])
|
||||
|
||||
@@ -73,9 +73,7 @@ class TestAssistant(unittest.TestCase):
|
||||
"choices": [
|
||||
{
|
||||
"message": {
|
||||
"tool_calls": [
|
||||
{"id": "1", "function": {"name": "test", "arguments": "{}"}}
|
||||
]
|
||||
"tool_calls": [{"id": "1", "function": {"name": "test", "arguments": "{}"}}]
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -107,9 +105,7 @@ class TestAssistant(unittest.TestCase):
|
||||
with patch("builtins.print"):
|
||||
process_message(assistant, "test message")
|
||||
|
||||
assistant.messages.append.assert_called_with(
|
||||
{"role": "user", "content": "test message"}
|
||||
)
|
||||
assistant.messages.append.assert_called_with({"role": "user", "content": "test message"})
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
+1
-3
@@ -93,9 +93,7 @@ def test_main_export_session_md(capsys):
|
||||
|
||||
def test_main_usage(capsys):
|
||||
usage = {"total_requests": 10, "total_tokens": 1000, "total_cost": 0.01}
|
||||
with patch(
|
||||
"pr.core.usage_tracker.UsageTracker.get_total_usage", return_value=usage
|
||||
):
|
||||
with patch("pr.core.usage_tracker.UsageTracker.get_total_usage", return_value=usage):
|
||||
with patch("sys.argv", ["pr", "--usage"]):
|
||||
main()
|
||||
captured = capsys.readouterr()
|
||||
|
||||
Reference in New Issue
Block a user