Add analytics risk guard and redesigned dashboard
This commit is contained in:
@@ -58,6 +58,34 @@ def test_live_spot_order_explicitly_disables_leverage(make_settings, tmp_path) -
|
||||
assert captured["payload"]["orderFilter"] == "Order"
|
||||
|
||||
|
||||
def test_private_get_signs_the_same_query_it_sends(make_settings, tmp_path) -> None:
|
||||
client = BybitClient(make_settings(tmp_path))
|
||||
captured = {}
|
||||
|
||||
class Response:
|
||||
def raise_for_status(self):
|
||||
return None
|
||||
|
||||
def json(self):
|
||||
return {"retCode": 0, "result": {"ok": True}}
|
||||
|
||||
class Session:
|
||||
def get(self, url, params, headers, timeout):
|
||||
captured["url"] = url
|
||||
captured["params"] = params
|
||||
captured["headers"] = headers
|
||||
captured["timeout"] = timeout
|
||||
return Response()
|
||||
|
||||
client.session = Session()
|
||||
|
||||
assert client.wallet_balance(coin=None) == {"ok": True}
|
||||
|
||||
assert captured["params"] == [("accountType", "UNIFIED")]
|
||||
assert "coin" not in dict(captured["params"])
|
||||
assert captured["headers"]["X-BAPI-SIGN"]
|
||||
|
||||
|
||||
def test_websocket_subscribe_uses_configured_kline_interval() -> None:
|
||||
payload = websocket_subscribe_message(["BTCUSDT"], interval="60")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user