Spaces:
Sleeping
Sleeping
| import sys | |
| import tempfile | |
| from pathlib import Path | |
| # Ensure project package imports work when run from workspace root | |
| sys.path.append(str(Path(__file__).resolve().parents[1])) | |
| from app.routers.web import generate_pdf_document | |
| if __name__ == '__main__': | |
| pdf = generate_pdf_document( | |
| "Test project description for UV run", | |
| { | |
| "product_owner": "# Product Vision\nThis is a test product.\n- Item A\n- Item B", | |
| "developer": "## Implementation\n- Use FastAPI\n- Use React" | |
| } | |
| ) | |
| out_path = Path(tempfile.gettempdir()) / "srs_test_uv.pdf" | |
| with open(out_path, "wb") as f: | |
| f.write(pdf.getvalue()) | |
| print(f"Wrote PDF to: {out_path}") | |
| print(f"Size: {out_path.stat().st_size} bytes") | |