File size: 754 Bytes
7108b9e
 
8807ee2
7108b9e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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")