MCPcopy Create free account
hub / github.com/sammchardy/python-binance / TestNonUserSockets

Class TestNonUserSockets

tests/test_user_socket_integration.py:132–147  ·  view source on GitHub ↗

Tests verifying other socket types still work normally.

Source from the content-addressed store, hash-verified

130
131
132class TestNonUserSockets:
133 """Tests verifying other socket types still work normally."""
134
135 @pytest.mark.asyncio
136 async def test_margin_socket_not_using_ws_api_subscription(self, clientAsync, socket_manager):
137 """Non-user KeepAliveWebsockets (like margin socket) should not use ws_api subscription."""
138 # margin_socket is a KeepAliveWebsocket with keepalive_type="margin"
139 # Create it but don't connect - just check the flag
140 margin_socket = socket_manager.margin_socket()
141
142 # Before connecting, the flag should be False (default)
143 assert margin_socket._uses_ws_api_subscription is False, \
144 "Margin socket should not use ws_api subscription"
145
146 # The _keepalive_type should be "margin", not "user"
147 assert margin_socket._keepalive_type == "margin"
148
149
150class TestWsApiSubscriptionRouting:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…