Product-ai / test_report.py
Parimal Kalpande
deploy
db70c95
#!/usr/bin/env python3
"""Test script to verify report generation works correctly"""
import os
import sys
sys.path.append('.')
from modules.report_generator import generate_pdf_report
import config
# Test data
test_data = {
'name': 'Test User',
'type': 'Product Strategy & Vision',
'q_and_a': [
{
'question': 'How would you define the product vision for a new mobile app?',
'response': 'I would start by understanding the target users, their pain points, and the market opportunity. Then I would create a compelling vision that aligns with business goals.',
'feedback': 'Great approach! You showed strong strategic thinking and considered multiple stakeholders.',
'overall_score': 8,
'scores': {'Strategic Thinking': 8, 'Problem Analysis': 7}
}
]
}
# Create test report
test_report_path = os.path.join(config.REPORT_FOLDER, 'test_report.pdf')
print(f"πŸ§ͺ Testing report generation...")
print(f"πŸ“ Report will be saved to: {test_report_path}")
try:
result = generate_pdf_report(test_data, test_report_path)
if result:
print(f"βœ… Test report generated successfully!")
print(f"πŸ“Š File size: {os.path.getsize(test_report_path)} bytes")
else:
print("❌ Report generation failed")
except Exception as e:
print(f"❌ Test failed with error: {e}")