resumebuilder / test_api.py
sakthi07's picture
pushing to hugging face
ab028ac
#!/usr/bin/env python3
"""
Test the PDF generation API endpoints.
"""
import requests
import json
import os
# Test the application endpoints
BASE_URL = "http://127.0.0.1:5000"
def test_api_endpoints():
"""Test the PDF generation endpoints."""
# First, check if the app is running
try:
response = requests.get(f"{BASE_URL}/")
if response.status_code == 200:
print("βœ“ Flask app is running")
else:
print("βœ— Flask app is not responding properly")
return
except:
print("βœ— Flask app is not running. Please start it with 'python app.py'")
return
# Test data - you'll need to be logged in first
print("\nTo test the PDF generation endpoints:")
print("1. Go to http://127.0.0.1:5000 and sign up/login")
print("2. Create a profile with some data")
print("3. Try generating PDF resumes from the profile page")
# The actual endpoints that will be called:
print("\nPDF generation endpoints:")
print("- POST /profile/generate-pdf/standard")
print("- POST /profile/generate-pdf/modern")
print("- POST /profile/generate-word")
if __name__ == "__main__":
test_api_endpoints()