Rename PDFContext->PdfContext

This commit is contained in:
James R. Barlow
2020-05-02 04:32:46 -07:00
parent e02f6c1e97
commit 5dbc080fa0
4 changed files with 10 additions and 10 deletions
+5 -5
View File
@@ -30,7 +30,7 @@ import pikepdf
import pytest
from pikepdf.models.metadata import decode_pdf_date
from ocrmypdf._jobcontext import PDFContext
from ocrmypdf._jobcontext import PdfContext
from ocrmypdf._pipeline import convert_to_pdfa
from ocrmypdf.cli import get_parser
from ocrmypdf.exceptions import ExitCode
@@ -298,7 +298,7 @@ def test_metadata_fixup_warning(resources, outdir, caplog):
copyfile(resources / 'graph.pdf', outdir / 'graph.pdf')
context = PDFContext(options, outdir, outdir / 'graph.pdf', None, None)
context = PdfContext(options, outdir, outdir / 'graph.pdf', None, None)
metadata_fixup(working_file=outdir / 'graph.pdf', context=context)
for record in caplog.records:
assert record.levelname != 'WARNING'
@@ -309,7 +309,7 @@ def test_metadata_fixup_warning(resources, outdir, caplog):
meta['prism2:publicationName'] = 'OCRmyPDF Test'
graph.save(outdir / 'graph_mod.pdf')
context = PDFContext(options, outdir, outdir / 'graph_mod.pdf', None, None)
context = PdfContext(options, outdir, outdir / 'graph_mod.pdf', None, None)
metadata_fixup(working_file=outdir / 'graph.pdf', context=context)
assert any(record.levelname == 'WARNING' for record in caplog.records)
@@ -329,7 +329,7 @@ def test_prevent_gs_invalid_xml(resources, outdir):
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, None)
context = PdfContext(options, outdir, outdir / 'layers.rendered.pdf', pdfinfo, None)
convert_to_pdfa(
str(outdir / 'layers.rendered.pdf'), str(outdir / 'pdfa.ps'), context
@@ -360,7 +360,7 @@ def test_malformed_docinfo(caplog, resources, outdir):
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, None)
context = PdfContext(options, outdir, outdir / 'layers.rendered.pdf', pdfinfo, None)
convert_to_pdfa(
str(outdir / 'layers.rendered.pdf'), str(outdir / 'pdfa.ps'), context