Spaces:
Sleeping
Sleeping
| #!/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}") | |