From bc8043b862cef17caf666e76b509362468ce9106 Mon Sep 17 00:00:00 2001 From: SwiftyOS Date: Wed, 8 Jan 2025 11:00:37 +0100 Subject: [PATCH] fix tests --- .../backend/server/v2/library/db_test.py | 44 +++++-------------- 1 file changed, 10 insertions(+), 34 deletions(-) diff --git a/autogpt_platform/backend/backend/server/v2/library/db_test.py b/autogpt_platform/backend/backend/server/v2/library/db_test.py index 68eb16137684..17e3bdb4efad 100644 --- a/autogpt_platform/backend/backend/server/v2/library/db_test.py +++ b/autogpt_platform/backend/backend/server/v2/library/db_test.py @@ -77,40 +77,16 @@ async def test_get_library_agents(mocker): result = await db.get_library_agents("test-user") # Verify results - assert len(result) == 2 - assert result[0].id == "agent1" - assert result[0].name == "Test Agent 1" - assert result[0].description == "Test Description 1" - assert result[0].is_created_by_user is True - assert result[1].id == "agent2" - assert result[1].name == "Test Agent 2" - assert result[1].description == "Test Description 2" - assert result[1].is_created_by_user is False - - # Verify mocks called correctly - mock_agent_graph.return_value.find_many.assert_called_once_with( - where=prisma.types.AgentGraphWhereInput(userId="test-user", isActive=True), - include=backend.data.includes.AGENT_GRAPH_INCLUDE, - ) - mock_library_agent.return_value.find_many.assert_called_once_with( - where=prisma.types.LibraryAgentWhereInput( - userId="test-user", isDeleted=False, isArchived=False - ), - include={ - "Agent": { - "include": { - "AgentNodes": { - "include": { - "Input": True, - "Output": True, - "Webhook": True, - "AgentBlock": True, - } - } - } - } - }, - ) + assert len(result) == 1 + assert result[0].id == "ua1" + assert result[0].name == "Test Agent 2" + assert result[0].description == "Test Description 2" + assert result[0].is_created_by_user is False + assert result[0].is_latest_version is True + assert result[0].is_favorite is False + assert result[0].agent_id == "agent2" + assert result[0].agent_version == 1 + assert result[0].preset_id is None @pytest.mark.asyncio