File size: 1,131 Bytes
3fe0726
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""
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)