Replace stub print/ app with full PDF web print service from ~/print-web-form. Adapt UPLOAD_FOLDER to use Path(__file__).parent, add pypdf dependency, port all tests (10 passing), remove unused static/.
13 lines
354 B
Python
13 lines
354 B
Python
from app import get_pdf_page_count
|
|
|
|
|
|
def test_page_count_valid_pdf(sample_pdf_path):
|
|
assert get_pdf_page_count(sample_pdf_path) == 3
|
|
|
|
|
|
def test_page_count_corrupt_file(corrupt_file_path):
|
|
assert get_pdf_page_count(corrupt_file_path) is None
|
|
|
|
|
|
def test_page_count_nonexistent_file():
|
|
assert get_pdf_page_count("/nonexistent/file.pdf") is None
|