refactor(V2): bybit client da pybit a httpx puro (parità V1)

This commit is contained in:
AdrianoDev
2026-05-01 01:35:26 +02:00
parent 95b8bcfe96
commit 6097dde4e4
4 changed files with 1149 additions and 620 deletions
+5 -8
View File
@@ -1,21 +1,18 @@
from __future__ import annotations
from unittest.mock import MagicMock
import pytest
from cerbero_mcp.exchanges.bybit.client import BybitClient
@pytest.fixture
def mock_http():
return MagicMock(name="pybit_HTTP")
def client():
"""BybitClient con base_url testnet e AsyncClient interno.
@pytest.fixture
def client(mock_http):
pytest-httpx intercetta le chiamate dell'AsyncClient httpx creato dal
costruttore (auto-mock), quindi non serve injection esplicita.
"""
return BybitClient(
api_key="test_key",
api_secret="test_secret",
testnet=True,
http=mock_http,
)