Fix stale auto-mode comment and harden GS-raises test
This commit is contained in:
@@ -489,7 +489,7 @@ def postprocess(
|
||||
else:
|
||||
pdf_out = pdf_file
|
||||
if context.options.output_type == 'auto':
|
||||
# Best effort PDF/A - never uses Ghostscript
|
||||
# Best effort PDF/A - may use Ghostscript as a last resort
|
||||
pdf_out, actual_type = try_auto_pdfa(pdf_out, context)
|
||||
# Store actual output type for reporting
|
||||
context.options.extra_attrs['_actual_output_type'] = actual_type
|
||||
|
||||
@@ -205,6 +205,7 @@ def test_auto_degrades_when_ghostscript_raises(resources, outpdf, monkeypatch):
|
||||
from ocrmypdf.exceptions import ColorConversionNeededError
|
||||
|
||||
monkeypatch.setattr('ocrmypdf._exec.verapdf.available', lambda: False)
|
||||
monkeypatch.setattr('ocrmypdf._exec.ghostscript.available', lambda: True)
|
||||
|
||||
def boom(*args, **kwargs):
|
||||
raise ColorConversionNeededError()
|
||||
@@ -219,6 +220,7 @@ def test_auto_degrades_when_ghostscript_raises(resources, outpdf, monkeypatch):
|
||||
'auto',
|
||||
)
|
||||
assert exitcode == ExitCode.ok
|
||||
assert outpdf.exists()
|
||||
assert not file_claims_pdfa(outpdf)['pass']
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user