port print-web-form app to nested flask structure
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/.
This commit is contained in:
parent
af5d3f148d
commit
b0c19d5642
9 changed files with 340 additions and 0 deletions
13
print/tests/test_pdf_utils.py
Normal file
13
print/tests/test_pdf_utils.py
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue