mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-12 12:06:04 +00:00
unit test fixes
This commit is contained in:
parent
55ca8a5c50
commit
090fa7007e
2 changed files with 5 additions and 5 deletions
|
|
@ -64,7 +64,7 @@ async def test_conversation_items(service):
|
||||||
assert len(item_list.data) == 1
|
assert len(item_list.data) == 1
|
||||||
assert item_list.data[0].id == "msg_test123"
|
assert item_list.data[0].id == "msg_test123"
|
||||||
|
|
||||||
items = await service.list(conversation.id)
|
items = await service.list_items(conversation.id)
|
||||||
assert len(items.data) == 1
|
assert len(items.data) == 1
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -102,7 +102,7 @@ async def test_openai_type_compatibility(service):
|
||||||
assert hasattr(item_list, attr)
|
assert hasattr(item_list, attr)
|
||||||
assert item_list.object == "list"
|
assert item_list.object == "list"
|
||||||
|
|
||||||
items = await service.list(conversation.id)
|
items = await service.list_items(conversation.id)
|
||||||
item = await service.retrieve(conversation.id, items.data[0].id)
|
item = await service.retrieve(conversation.id, items.data[0].id)
|
||||||
item_dict = item.model_dump()
|
item_dict = item.model_dump()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ class TestConversationValidation:
|
||||||
conv_id = "conv_nonexistent"
|
conv_id = "conv_nonexistent"
|
||||||
|
|
||||||
# Mock conversation not found
|
# Mock conversation not found
|
||||||
mock_conversations_api.list.side_effect = ConversationNotFoundError("conv_nonexistent")
|
mock_conversations_api.list_items.side_effect = ConversationNotFoundError("conv_nonexistent")
|
||||||
|
|
||||||
with pytest.raises(ConversationNotFoundError):
|
with pytest.raises(ConversationNotFoundError):
|
||||||
await responses_impl_with_conversations.create_openai_response(
|
await responses_impl_with_conversations.create_openai_response(
|
||||||
|
|
@ -160,7 +160,7 @@ class TestIntegrationWorkflow:
|
||||||
self, responses_impl_with_conversations, mock_conversations_api
|
self, responses_impl_with_conversations, mock_conversations_api
|
||||||
):
|
):
|
||||||
"""Test creating a response with a valid conversation parameter."""
|
"""Test creating a response with a valid conversation parameter."""
|
||||||
mock_conversations_api.list.return_value = ConversationItemList(
|
mock_conversations_api.list_items.return_value = ConversationItemList(
|
||||||
data=[], first_id=None, has_more=False, last_id=None, object="list"
|
data=[], first_id=None, has_more=False, last_id=None, object="list"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -227,7 +227,7 @@ class TestIntegrationWorkflow:
|
||||||
self, responses_impl_with_conversations, mock_conversations_api
|
self, responses_impl_with_conversations, mock_conversations_api
|
||||||
):
|
):
|
||||||
"""Test creating a response with a non-existent conversation."""
|
"""Test creating a response with a non-existent conversation."""
|
||||||
mock_conversations_api.list.side_effect = ConversationNotFoundError("conv_nonexistent")
|
mock_conversations_api.list_items.side_effect = ConversationNotFoundError("conv_nonexistent")
|
||||||
|
|
||||||
with pytest.raises(ConversationNotFoundError) as exc_info:
|
with pytest.raises(ConversationNotFoundError) as exc_info:
|
||||||
await responses_impl_with_conversations.create_openai_response(
|
await responses_impl_with_conversations.create_openai_response(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue