Spaces:
Running
Running
| """ | |
| Quick test script for the fundamental analyzer | |
| """ | |
| import sys | |
| from fundamental_analysis.main import analyze_stock | |
| def test_basic_analysis(): | |
| """Test basic analysis with a well-known ticker""" | |
| print("=" * 80) | |
| print("Testing Fundamental Analyzer with AAPL") | |
| print("=" * 80) | |
| print() | |
| try: | |
| # Test with Apple, comparing against major tech peers | |
| peer_tickers = ["MSFT", "GOOGL", "META"] | |
| print("Running analysis for AAPL with peers: MSFT, GOOGL, META") | |
| print("-" * 80) | |
| print() | |
| analyze_stock("AAPL", peer_tickers) | |
| print() | |
| print("=" * 80) | |
| print("✓ Test completed successfully!") | |
| print("=" * 80) | |
| except Exception as e: | |
| print() | |
| print("=" * 80) | |
| print(f"✗ Test failed with error: {type(e).__name__}") | |
| print(f"Error message: {str(e)}") | |
| print("=" * 80) | |
| import traceback | |
| traceback.print_exc() | |
| return False | |
| return True | |
| if __name__ == "__main__": | |
| success = test_basic_analysis() | |
| sys.exit(0 if success else 1) | |