Test the report tool with custom output path
()
| 72 | |
| 73 | |
| 74 | async def test_with_custom_output_path(): |
| 75 | """Test the report tool with custom output path""" |
| 76 | print("\n" + "="*60) |
| 77 | print("🧪 Test 2: Custom Output Path") |
| 78 | print("="*60) |
| 79 | |
| 80 | # Initialize tools |
| 81 | await tcp.initialize(["report"]) |
| 82 | |
| 83 | query = "Tesla stock analysis and recent market trends" |
| 84 | custom_path = "workdir/test_reports/custom_report.html" |
| 85 | |
| 86 | try: |
| 87 | result = await tcp.ainvoke("report", { |
| 88 | "query": query, |
| 89 | "output_path": custom_path |
| 90 | }) |
| 91 | |
| 92 | print(f"\n📋 Query: {query}") |
| 93 | print(f"📁 Custom Path: {custom_path}") |
| 94 | print("\n📄 Result:") |
| 95 | print("-" * 60) |
| 96 | print(result.message if hasattr(result, 'message') else result) |
| 97 | print("-" * 60) |
| 98 | |
| 99 | print("\n✅ Custom output path test completed!") |
| 100 | |
| 101 | except Exception as e: |
| 102 | print(f"\n❌ Error: {e}") |
| 103 | import traceback |
| 104 | traceback.print_exc() |
| 105 | |
| 106 | |
| 107 | def test_standalone_execution(): |
no test coverage detected