"""Tests for ConversationManager structure."""

import pytest
import sys
from pathlib import Path

sys.path.insert(0, str(Path(__file__).resolve().parent.parent / "backend"))


class TestConversationManagerStructure:
    def test_has_required_methods(self):
        from conversations.conversation_manager import ConversationManager
        methods = ['create_conversation', 'list_conversations', 'get_conversation',
                   'add_message', 'get_messages', 'delete_conversation']
        for method in methods:
            assert hasattr(ConversationManager, method), f"Missing method: {method}"

    def test_history_for_claude_excludes_data(self):
        """The conversation history sent to Claude should not include data values."""
        import inspect
        from conversations.conversation_manager import ConversationManager
        source = inspect.getsource(ConversationManager.get_conversation_history_for_claude)
        # Should only select role and content, not result data
        assert "role" in source
        assert "content" in source
