Spaces:
Sleeping
Sleeping
File size: 1,283 Bytes
b091b2c |
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 |
#!/usr/bin/env python3
"""
Quick test for ChartDataTool cleanup functionality
"""
import asyncio
import sys
import os
# Add src to path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'src'))
from src.tools.chart_data_tool import ChartDataTool
async def test_chart_tool_cleanup():
"""Test that ChartDataTool works and cleanup doesn't throw errors"""
print("π§ͺ Testing ChartDataTool...")
tool = ChartDataTool()
try:
# Test basic functionality
print("π Testing price chart data...")
result = await tool._arun("price_chart", "bitcoin", "7d")
print(f"β
Chart data result: {len(result)} characters")
# Test cleanup method exists and works
print("π§Ή Testing cleanup method...")
await tool.cleanup()
print("β
Cleanup method executed successfully")
return True
except Exception as e:
print(f"β Test failed: {e}")
return False
async def main():
success = await test_chart_tool_cleanup()
if success:
print("\nπ All tests passed!")
return 0
else:
print("\nβ Tests failed!")
return 1
if __name__ == "__main__":
exit_code = asyncio.run(main())
sys.exit(exit_code)
|