from unittest.mock import AsyncMock, MagicMock
from contextlib import asynccontextmanager


from .streaming import get_message_streamer


async def test_get_message_streamer():
    broker = MagicMock()

    @asynccontextmanager
    async def connection():
        yield AsyncMock()

    broker._connection = connection()

    streamer = get_message_streamer(AsyncMock())

    assert streamer

    # FIXME real assertions missing.
