summaryrefslogtreecommitdiff
path: root/services/data-collector/tests/test_ws_factory.py
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2026-04-01 17:46:56 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2026-04-01 17:46:56 +0900
commitc294e9df6207973306f58186d278e12399f162a3 (patch)
tree9f847439eb29c82a77da0dcf7fe426cfa0cbe65b /services/data-collector/tests/test_ws_factory.py
parent69e88b3b353f1a2ab7a78259b480e8afbd87669c (diff)
fix: WS factory, backtester config, CI docker builds, health port docs
Diffstat (limited to 'services/data-collector/tests/test_ws_factory.py')
-rw-r--r--services/data-collector/tests/test_ws_factory.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/services/data-collector/tests/test_ws_factory.py b/services/data-collector/tests/test_ws_factory.py
new file mode 100644
index 0000000..ef0449c
--- /dev/null
+++ b/services/data-collector/tests/test_ws_factory.py
@@ -0,0 +1,18 @@
+"""Tests for WebSocket factory."""
+import pytest
+from data_collector.ws_factory import create_websocket, SUPPORTED_WS
+from data_collector.binance_ws import BinanceWebSocket
+
+
+def test_create_binance_ws():
+ ws = create_websocket("binance", symbols=["BTCUSDT"], timeframe="1m", on_candle=lambda c: None)
+ assert isinstance(ws, BinanceWebSocket)
+
+
+def test_create_unsupported_exchange():
+ with pytest.raises(ValueError, match="not supported"):
+ create_websocket("unsupported_exchange", symbols=["BTCUSDT"], timeframe="1m", on_candle=lambda c: None)
+
+
+def test_supported_exchanges():
+ assert "binance" in SUPPORTED_WS