plexus.cli.score_chat.test_graphql_service module

Test suite for GraphQL-based chat service.

Following TDD principles, these tests define the expected behavior of the GraphQL chat system before implementation.

class plexus.cli.score_chat.test_graphql_service.TestConvenienceFunctions

Bases: object

Test the convenience functions for creating and resuming chat sessions.

async test_create_chat_session()

Test the create_chat_session convenience function.

async test_resume_chat_session()

Test the resume_chat_session convenience function.

class plexus.cli.score_chat.test_graphql_service.TestExperimentIntegration

Bases: object

Test experiment-specific chat functionality.

mock_client()

Mock client with experiment-related methods.

async test_query_experiment_chat_sessions(mock_client)

Test querying all chat sessions for an experiment.

async test_query_experiment_messages_chronological(mock_client)

Test querying chronologically-sorted messages for an experiment.

class plexus.cli.score_chat.test_graphql_service.TestFileEditorIntegration

Bases: object

Test integration with existing FileEditor functionality.

async test_file_editor_preserved()

Test that FileEditor functionality is preserved in GraphQL service.

async test_score_chat_service_integration()

Test that the GraphQL service inherits all ScoreChatService functionality.

class plexus.cli.score_chat.test_graphql_service.TestGraphQLChatService

Bases: object

Test the GraphQL chat service functionality.

chat_service(mock_client)

Create a chat service instance with mocked client.

mock_client()

Mock PlexusDashboardClient for testing.

async test_create_session_basic(chat_service, mock_client)

Test creating a basic chat session.

async test_create_session_with_experiment(mock_client)

Test creating a chat session associated with an experiment.

async test_end_session(chat_service, mock_client)

Test ending a chat session.

async test_end_session_no_active_session(chat_service)

Test ending a session when no session is active.

async test_process_message_with_graphql(chat_service, mock_client)

Test processing a message end-to-end with GraphQL persistence.

async test_send_message_no_session_error(chat_service)

Test that sending a message without a session raises an error.

async test_send_message_user(chat_service, mock_client)

Test sending a user message.

async test_send_message_with_experiment_id(mock_client)

Test that messages include experimentId for GSI queries.