41 lines
839 B
Python
41 lines
839 B
Python
from __future__ import annotations
|
|
|
|
from unittest.mock import MagicMock
|
|
|
|
import pytest
|
|
|
|
from mcp_alpaca.client import AlpacaClient
|
|
|
|
|
|
@pytest.fixture
|
|
def mock_trading():
|
|
return MagicMock(name="alpaca_TradingClient")
|
|
|
|
|
|
@pytest.fixture
|
|
def mock_stock():
|
|
return MagicMock(name="alpaca_StockHistoricalDataClient")
|
|
|
|
|
|
@pytest.fixture
|
|
def mock_crypto():
|
|
return MagicMock(name="alpaca_CryptoHistoricalDataClient")
|
|
|
|
|
|
@pytest.fixture
|
|
def mock_option():
|
|
return MagicMock(name="alpaca_OptionHistoricalDataClient")
|
|
|
|
|
|
@pytest.fixture
|
|
def client(mock_trading, mock_stock, mock_crypto, mock_option):
|
|
return AlpacaClient(
|
|
api_key="test_key",
|
|
secret_key="test_secret",
|
|
paper=True,
|
|
trading=mock_trading,
|
|
stock_data=mock_stock,
|
|
crypto_data=mock_crypto,
|
|
option_data=mock_option,
|
|
)
|