From 090fa7007ed1db76ccc57729852a4aca20c34e8d Mon Sep 17 00:00:00 2001 From: Ashwin Bharambe Date: Wed, 22 Oct 2025 12:12:16 -0700 Subject: [PATCH] unit test fixes --- tests/unit/conversations/test_conversations.py | 4 ++-- .../meta_reference/test_openai_responses_conversations.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/unit/conversations/test_conversations.py b/tests/unit/conversations/test_conversations.py index 65c3e2333..032d4498a 100644 --- a/tests/unit/conversations/test_conversations.py +++ b/tests/unit/conversations/test_conversations.py @@ -64,7 +64,7 @@ async def test_conversation_items(service): assert len(item_list.data) == 1 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 @@ -102,7 +102,7 @@ async def test_openai_type_compatibility(service): assert hasattr(item_list, attr) 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_dict = item.model_dump() diff --git a/tests/unit/providers/agents/meta_reference/test_openai_responses_conversations.py b/tests/unit/providers/agents/meta_reference/test_openai_responses_conversations.py index 2ca350862..c2c113c1b 100644 --- a/tests/unit/providers/agents/meta_reference/test_openai_responses_conversations.py +++ b/tests/unit/providers/agents/meta_reference/test_openai_responses_conversations.py @@ -62,7 +62,7 @@ class TestConversationValidation: conv_id = "conv_nonexistent" # 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): await responses_impl_with_conversations.create_openai_response( @@ -160,7 +160,7 @@ class TestIntegrationWorkflow: self, responses_impl_with_conversations, mock_conversations_api ): """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" ) @@ -227,7 +227,7 @@ class TestIntegrationWorkflow: self, responses_impl_with_conversations, mock_conversations_api ): """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: await responses_impl_with_conversations.create_openai_response(