merge annotate /ANNOTATE/core into /core.
fix chart updates
This commit is contained in:
57
test_annotate_init.py
Normal file
57
test_annotate_init.py
Normal file
@@ -0,0 +1,57 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Test ANNOTATE app initialization after refactoring
|
||||
"""
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
sys.path.insert(0, str(Path(__file__).parent))
|
||||
|
||||
# Add ANNOTATE to path
|
||||
annotate_dir = Path(__file__).parent / "ANNOTATE"
|
||||
sys.path.insert(0, str(annotate_dir))
|
||||
|
||||
def test_annotate_init():
|
||||
"""Test that ANNOTATE app can initialize properly"""
|
||||
|
||||
print("Testing ANNOTATE app initialization...")
|
||||
print("-" * 50)
|
||||
|
||||
try:
|
||||
# Import the ANNOTATE app
|
||||
from web.app import AnnotationDashboard
|
||||
|
||||
print("✅ ANNOTATE app imported successfully")
|
||||
|
||||
# Try to initialize it
|
||||
dashboard = AnnotationDashboard()
|
||||
|
||||
print("✅ AnnotationDashboard initialized successfully")
|
||||
|
||||
# Check if data_provider is available
|
||||
if dashboard.data_provider:
|
||||
print("✅ DataProvider is available")
|
||||
|
||||
# Test the chart data method
|
||||
df = dashboard.data_provider.get_data_for_annotation(
|
||||
symbol='ETH/USDT',
|
||||
timeframe='1m',
|
||||
limit=5,
|
||||
direction='latest'
|
||||
)
|
||||
|
||||
if df is not None and not df.empty:
|
||||
print(f"✅ Chart data working: {len(df)} candles")
|
||||
print("✅ ANNOTATE app fully functional!")
|
||||
else:
|
||||
print("❌ Chart data not available")
|
||||
else:
|
||||
print("❌ DataProvider not available")
|
||||
|
||||
except Exception as e:
|
||||
print(f"❌ Error: {e}")
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_annotate_init()
|
||||
Reference in New Issue
Block a user