import pytest from backend.rag.pdf_parser import parse_pdf_layout import os # We'll use a simple mock/test check if possible, or just verify the structure def test_parse_pdf_layout_structure(): # Since creating a real PDF in-memory is hard without extra libs, # we'll just check if the function handles empty/invalid bytes gracefully # or expect a specific error if lib fails on junk. with pytest.raises(Exception): parse_pdf_layout(b"not a pdf")