Skip to content

Commit

Permalink
fix(test_structuredbot)šŸ›: Ensure correct JSON string handling in mockā€¦
Browse files Browse the repository at this point in the history
ā€¦ response

- Correct the format of mock_response.content to be a JSON string.
  • Loading branch information
ericmjl committed Dec 20, 2024
1 parent 10bb4ec commit 083e749
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/bot/test_structuredbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def test_structuredbot_allow_failed_validation(mocker):
"""Test that StructuredBot returns partial data when allow_failed_validation=True."""
# Mock the API response with invalid data (negative number)
mock_response = mocker.MagicMock()
mock_response.content = {"required_field": "test", "number_field": -1}
mock_response.content = '{"required_field": "test", "number_field": -1}'
mocker.patch(
"llamabot.bot.structuredbot.SimpleBot.stream_none", return_value=mock_response
)
Expand Down

0 comments on commit 083e749

Please sign in to comment.