gaia-enhanced-agent / test_pypdf_dependency.py
GAIA Agent Deployment
Deploy Complete Enhanced GAIA Agent with Phase 1-6 Improvements
9a6a4dc
#!/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)