"""
Test cases for quantfolio package
"""

import pytest
import numpy as np
from quantfolio import HybridOptimizer


def test_optimizer_creation():
    """Test creating optimizer"""
    optimizer = HybridOptimizer(['AAPL', 'MSFT'])
    assert optimizer.n_assets == 2
    assert len(optimizer.tickers) == 2


def test_optimizer_risk_aversion():
    """Test risk aversion parameter"""
    optimizer = HybridOptimizer(['AAPL', 'MSFT'], risk_aversion=0.7)
    assert optimizer.risk_aversion == 0.7


def test_method_validation():
    """Test method parameter validation"""
    optimizer = HybridOptimizer(['AAPL'], method='quantum')
    assert optimizer.method == 'quantum'
    
    optimizer = HybridOptimizer(['AAPL'], method='classical')
    assert optimizer.method == 'classical'


# Note: Full optimization tests require data download
# These are integration tests that should be run separately
def test_simple_weights_sum():
    """Test that weights sum to 1"""
    # This would require mocking or actual data
    pass


if __name__ == '__main__':
    pytest.main([__file__, '-v'])
