File size: 1,677 Bytes
9a6a4dc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env python3
"""
Test pypdf dependency for PDF processing functionality
"""

def test_pypdf_import():
    """Test that pypdf can be imported successfully."""
    try:
        import pypdf
        print("βœ… pypdf import successful")
        print(f"βœ… pypdf version: {pypdf.__version__}")
        return True
    except ImportError as e:
        print(f"❌ pypdf import failed: {e}")
        return False

def test_pypdf_basic_functionality():
    """Test basic pypdf functionality."""
    try:
        from pypdf import PdfReader
        print("βœ… PdfReader import successful")
        
        # Test that we can create a PdfReader instance (without actual file)
        print("βœ… pypdf basic functionality available")
        return True
    except Exception as e:
        print(f"❌ pypdf functionality test failed: {e}")
        return False

def main():
    """Run pypdf dependency tests."""
    print("πŸ” Testing pypdf dependency...")
    
    tests = [
        ("pypdf Import", test_pypdf_import),
        ("pypdf Functionality", test_pypdf_basic_functionality)
    ]
    
    passed = 0
    total = len(tests)
    
    for test_name, test_func in tests:
        if test_func():
            passed += 1
            print(f"βœ… {test_name}: PASSED")
        else:
            print(f"❌ {test_name}: FAILED")
    
    print(f"\nπŸ“Š pypdf Tests: {passed}/{total} passed")
    
    if passed == total:
        print("πŸŽ‰ pypdf dependency ready for PDF processing!")
        return True
    else:
        print("⚠️ pypdf dependency issues detected")
        return False

if __name__ == "__main__":
    success = main()
    exit(0 if success else 1)