async def test_memory_with_all_block_types(memory_with_blocks):
    """Test getting all memory block types together."""
    # Set up block content
    chat_history = [ChatMessage(role="user", content="Current message")]

    # Get final messages with memory blocks included
    messages = await memory_with_blocks.aget()

    # Should have properly inserted all memory content
    assert len(messages) > 0

    # Should have a system message with memory blocks
    system_messages = [msg for msg in messages if msg.role == "system"]
    assert len(system_messages) > 0

    # The system message should contain content from our blocks
    system_content = system_messages[0].blocks[0].text
    assert "Simple text content from TextMemoryBlock" in system_content
    assert "Text block 1" in system_content
    assert "Text block 2" in system_content

    # Should also include direct chat messages from ChatMessagesMemoryBlock
    user_historical = [
        msg for msg in messages if msg.content == "Historical user message"
    ]
    assert len(user_historical) > 0
Test getting all memory block types together.
llama-index-core/tests/memory/test_memory_blocks_base.py