Skip to content

Commit 5b737ab

Browse files
committed
test: update tests usage -> gneration.usage
More new tests need fixing after rebase. Signed-off-by: Mark Sturdevant <mark.sturdevant@ibm.com>
1 parent e46afd3 commit 5b737ab

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

test/cli/test_serve_integration.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def test_streaming_content_chunks(self, client, mock_module):
196196
def test_streaming_with_usage_field(self, client, mock_module):
197197
"""Test streaming response includes usage when stream_options.include_usage=True."""
198198
mock_output = ModelOutputThunk("Response")
199-
mock_output.usage = {
199+
mock_output.generation.usage = {
200200
"prompt_tokens": 10,
201201
"completion_tokens": 5,
202202
"total_tokens": 15,
@@ -346,7 +346,7 @@ def test_tool_calls_with_usage_info(self, client, mock_module):
346346
name="get_weather", func=mock_tool, args={"location": "Paris"}
347347
)
348348
}
349-
mock_output.usage = {
349+
mock_output.generation.usage = {
350350
"prompt_tokens": 50,
351351
"completion_tokens": 20,
352352
"total_tokens": 70,
@@ -481,7 +481,7 @@ def test_streaming_tool_calls_with_usage(self, client, mock_module):
481481
name="get_weather", func=mock_tool, args={"location": "Paris"}
482482
)
483483
}
484-
mock_output.usage = {
484+
mock_output.generation.usage = {
485485
"prompt_tokens": 30,
486486
"completion_tokens": 15,
487487
"total_tokens": 45,

test/cli/test_serve_tool_calling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ async def test_tool_calls_with_usage_info(self, mock_module, sample_tool_request
275275
name="get_weather", func=mock_tool, args={"location": "Paris"}
276276
)
277277
}
278-
mock_output.usage = {
278+
mock_output.generation.usage = {
279279
"prompt_tokens": 50,
280280
"completion_tokens": 20,
281281
"total_tokens": 70,

0 commit comments

Comments
 (0)