diff options
Diffstat (limited to 'shared/tests/test_broker.py')
| -rw-r--r-- | shared/tests/test_broker.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/shared/tests/test_broker.py b/shared/tests/test_broker.py index d3a3569..ea8b148 100644 --- a/shared/tests/test_broker.py +++ b/shared/tests/test_broker.py @@ -1,7 +1,8 @@ """Tests for the Redis broker.""" + import pytest import json -from unittest.mock import AsyncMock, MagicMock, patch +from unittest.mock import AsyncMock, patch @pytest.mark.asyncio @@ -12,6 +13,7 @@ async def test_broker_publish(): mock_from_url.return_value = mock_redis from shared.broker import RedisBroker + broker = RedisBroker("redis://localhost:6379") data = {"type": "CANDLE", "symbol": "BTCUSDT"} await broker.publish("candles", data) @@ -43,6 +45,7 @@ async def test_broker_subscribe_returns_messages(): ] from shared.broker import RedisBroker + broker = RedisBroker("redis://localhost:6379") messages = await broker.read("candles", last_id="$") @@ -60,6 +63,7 @@ async def test_broker_close(): mock_from_url.return_value = mock_redis from shared.broker import RedisBroker + broker = RedisBroker("redis://localhost:6379") await broker.close() |
