mirror of
https://github.com/ocrmypdf/OCRmyPDF.git
synced 2025-06-26 23:49:59 +00:00
Remove test since ghostscript error handling changed
This commit is contained in:
parent
4143154e91
commit
6851ea7f11
@ -398,42 +398,3 @@ def test_prevent_gs_invalid_xml(resources, outdir):
|
||||
# Ensure we did not carry the nul forward.
|
||||
assert contents.find(b'�', xmp_start, xmp_end) == -1, "found escaped nul"
|
||||
assert contents.find(b'\x00', xmp_start, xmp_end) == -1
|
||||
|
||||
|
||||
@pytest.mark.xfail(
|
||||
ghostscript.version() >= Version('10.01.2'),
|
||||
reason=(
|
||||
"Ghostscript now exits with an error on invalid DocumentInfo, defeating "
|
||||
"this test.",
|
||||
),
|
||||
)
|
||||
def test_malformed_docinfo(caplog, resources, outdir):
|
||||
generate_pdfa_ps(outdir / 'pdfa.ps')
|
||||
|
||||
with pikepdf.open(resources / 'trivial.pdf') as pdf:
|
||||
pdf.trailer.Info = pikepdf.Stream(pdf, b"<xml></xml>")
|
||||
pdf.save(outdir / 'layers.rendered.pdf', fix_metadata_version=False)
|
||||
|
||||
_, options, _ = get_parser_options_plugins(
|
||||
args=[
|
||||
'-j',
|
||||
'1',
|
||||
'--output-type',
|
||||
'pdfa-2',
|
||||
'a.pdf',
|
||||
'b.pdf',
|
||||
]
|
||||
)
|
||||
pdfinfo = PdfInfo(outdir / 'layers.rendered.pdf')
|
||||
context = PdfContext(
|
||||
options, outdir, outdir / 'layers.rendered.pdf', pdfinfo, get_plugin_manager([])
|
||||
)
|
||||
|
||||
convert_to_pdfa(
|
||||
str(outdir / 'layers.rendered.pdf'), str(outdir / 'pdfa.ps'), context
|
||||
)
|
||||
|
||||
print(caplog.records)
|
||||
assert any(
|
||||
'malformed DocumentInfo block' in record.message for record in caplog.records
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user