Spaces:
Running
Running
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) |