-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_uv_setup.py
More file actions
96 lines (71 loc) · 2.38 KB
/
test_uv_setup.py
File metadata and controls
96 lines (71 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/usr/bin/env python3
"""
Script de prueba para verificar que el sistema funciona correctamente con uv
"""
import logging
import sys
# Configurar logging básico
logging.basicConfig(
level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s",
)
def test_imports():
"""Prueba las importaciones principales"""
try:
# Core modules
# Brokers
# Config
# Risk
print("✅ Todas las importaciones principales funcionan correctamente")
return True
except Exception as e:
print(f"❌ Error en importaciones: {e}")
return False
def test_quant_engine():
"""Prueba el motor cuantitativo"""
try:
from core.quant_engine import QuantitativeEngine
engine = QuantitativeEngine()
print("✅ QuantitativeEngine inicializado correctamente")
# Prueba cálculo de tamaño de posición
position_size = engine.calculate_optimal_position_size(
account_balance=10000.0, entry_score=0.75,
)
print(f"✅ Cálculo de posición: {position_size:.4f}")
return True
except Exception as e:
print(f"❌ Error en QuantitativeEngine: {e}")
return False
def test_config_loading():
"""Prueba carga de configuración"""
try:
from config.config_manager import config_manager
# Probar obtener valor de configuración
donchian_period = config_manager.get("DONCHIAN_PERIOD", 20)
print(f"✅ Configuración accesible: DONCHIAN_PERIOD = {donchian_period}")
return True
except Exception as e:
print(f"❌ Error cargando configuración: {e}")
return False
def main():
"""Función principal de pruebas"""
print("=" * 50)
print("🧪 TEST DE VERIFICACIÓN DEL SISTEMA CON UV")
print("=" * 50)
tests_passed = 0
total_tests = 3
# Ejecutar tests
if test_imports():
tests_passed += 1
if test_quant_engine():
tests_passed += 1
if test_config_loading():
tests_passed += 1
print("=" * 50)
print(f"RESULTADOS: {tests_passed}/{total_tests} tests pasados")
if tests_passed == total_tests:
print("🎉 ¡Todos los tests pasaron! El sistema está listo para usar con uv.")
return 0
print("⚠️ Algunos tests fallaron. Revisa los errores arriba.")
return 1
if __name__ == "__main__":
sys.exit(main())