Skip to content

Commit 1f3fe93

Browse files
authored
fix: add FuturesDepthCacheManager and OptionsDepthCacheManager to __init__ (sammchardy#1513)
1 parent 61a9849 commit 1f3fe93

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

binance/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
DepthCacheManager, # noqa
1313
OptionsDepthCacheManager, # noqa
1414
ThreadedDepthCacheManager, # noqa
15+
FuturesDepthCacheManager, # noqa
16+
OptionsDepthCacheManager, # noqa
1517
)
1618
from binance.ws.streams import (
1719
BinanceSocketManager, # noqa

tests/test_init.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
from binance import (
2+
AsyncClient,
3+
Client,
4+
DepthCacheManager,
5+
OptionsDepthCacheManager,
6+
ThreadedDepthCacheManager,
7+
FuturesDepthCacheManager,
8+
BinanceSocketManager,
9+
ThreadedWebsocketManager,
10+
BinanceSocketType,
11+
KeepAliveWebsocket,
12+
ReconnectingWebsocket
13+
)
14+
15+
def test_version():
16+
"""Test that __version__ is defined"""
17+
from binance import __version__
18+
assert isinstance(__version__, str)
19+
assert __version__ is not None
20+
21+
def test_client_import():
22+
"""Test Client class import"""
23+
assert Client is not None
24+
assert isinstance(Client, type)
25+
26+
def test_async_client_import():
27+
"""Test AsyncClient class import"""
28+
assert AsyncClient is not None
29+
assert isinstance(AsyncClient, type)
30+
31+
def test_depth_cache_imports():
32+
"""Test depth cache related imports"""
33+
assert DepthCacheManager is not None
34+
assert OptionsDepthCacheManager is not None
35+
assert ThreadedDepthCacheManager is not None
36+
assert FuturesDepthCacheManager is not None
37+
assert isinstance(DepthCacheManager, type)
38+
assert isinstance(OptionsDepthCacheManager, type)
39+
assert isinstance(ThreadedDepthCacheManager, type)
40+
assert isinstance(FuturesDepthCacheManager, type)
41+
42+
def test_websocket_imports():
43+
"""Test websocket related imports"""
44+
assert BinanceSocketManager is not None
45+
assert ThreadedWebsocketManager is not None
46+
assert BinanceSocketType is not None
47+
assert isinstance(BinanceSocketManager, type)
48+
assert isinstance(ThreadedWebsocketManager, type)
49+
50+
def test_websocket_utility_imports():
51+
"""Test websocket utility imports"""
52+
assert KeepAliveWebsocket is not None
53+
assert ReconnectingWebsocket is not None
54+
assert isinstance(KeepAliveWebsocket, type)
55+
assert isinstance(ReconnectingWebsocket, type)

0 commit comments

Comments
 (0)