Local changes: Updated model training, removed debug instrumentation, and configuration improvements
This commit is contained in:
47
tests/integration/test_trading_workflow.py
Normal file
47
tests/integration/test_trading_workflow.py
Normal file
@@ -0,0 +1,47 @@
|
||||
"""Integration tests for trading workflow."""
|
||||
|
||||
import pytest
|
||||
from unittest.mock import Mock, AsyncMock, patch
|
||||
from src.trading.engine import get_trading_engine
|
||||
from src.strategies.technical.rsi_strategy import RSIStrategy
|
||||
|
||||
|
||||
@pytest.mark.integration
|
||||
class TestTradingWorkflow:
|
||||
"""Integration tests for complete trading workflow."""
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_complete_trading_workflow(self, mock_database):
|
||||
"""Test complete trading workflow."""
|
||||
# Initialize trading engine
|
||||
engine = get_trading_engine()
|
||||
await engine.initialize()
|
||||
|
||||
# Create strategy
|
||||
strategy = RSIStrategy(
|
||||
strategy_id=1,
|
||||
name="test_rsi",
|
||||
symbol="BTC/USD",
|
||||
timeframe="1h",
|
||||
parameters={"rsi_period": 14}
|
||||
)
|
||||
|
||||
# Start strategy
|
||||
await engine.start_strategy(strategy)
|
||||
|
||||
# Execute trade (paper trading)
|
||||
result = await engine.execute_trade(
|
||||
exchange_name="paper_trading",
|
||||
strategy_id=1,
|
||||
symbol="BTC/USD",
|
||||
side="buy",
|
||||
order_type="market",
|
||||
amount=0.01,
|
||||
is_paper_trade=True
|
||||
)
|
||||
|
||||
assert result is not None
|
||||
|
||||
# Cleanup
|
||||
await engine.shutdown()
|
||||
|
||||
Reference in New Issue
Block a user