|
| 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