Improve context logging output

This commit is contained in:
gabrii
2025-09-30 14:35:29 +02:00
parent 4fdd215938
commit 9d1d9ee4e7
3 changed files with 138 additions and 47 deletions
+5 -4
View File
@@ -15,11 +15,12 @@ class TestModelInvalidJson(ReplyBase):
def test(self, testapp, requests_mock, mocker):
"""Test logging of context containing an invalid JSON tool call."""
console_print = mocker.patch(
"rich.console.Console.print", return_value=mocker.Mock()
)
mocker.patch("rich.console.Console.print")
console_print = mocker.patch("rich.padding.Padding.__init__", return_value=None)
super().test(testapp, requests_mock)
console_print.assert_any_call("[red]Invalid JSON generated by the model:[/red]")
console_print.assert_any_call(
"[red]Invalid JSON generated by the model:[/red]", (0, 4)
)
def test_redact_headers():