fix(pdfa): address code review - validate pdfa_format, add S3 comment, add format test

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-02 14:01:26 +00:00
parent a03b3af933
commit 144a90fa73
2 changed files with 12 additions and 1 deletions
+5
View File
@@ -73,6 +73,11 @@ class TestConvertPdfToPdfa:
cmd = mock_run.call_args[0][0]
assert f"pdfa-{fmt}" in cmd
def test_invalid_pdfa_format_rejected(self):
"""Test that invalid PDF/A format values are rejected."""
result = _convert_pdf_to_pdfa("/input.pdf", "/output.pdf", "invalid")
assert result is False
@patch("app.tasks.convert_to_pdfa.subprocess.run")
@patch("app.tasks.convert_to_pdfa.shutil.which", return_value="/usr/bin/ocrmypdf")
def test_conversion_failure_empty_stderr(self, mock_which, mock_run):