mirror of
https://github.com/ocrmypdf/OCRmyPDF.git
synced 2025-06-26 23:49:59 +00:00
25 lines
594 B
Python
25 lines
594 B
Python
# SPDX-FileCopyrightText: 2023 James R. Barlow
|
|
# SPDX-License-Identifier: MPL-2.0
|
|
|
|
from __future__ import annotations
|
|
|
|
import pytest
|
|
|
|
import ocrmypdf
|
|
|
|
|
|
def test_block_tagged(resources):
|
|
with pytest.raises(ocrmypdf.exceptions.TaggedPDFError):
|
|
ocrmypdf.ocr(resources / 'tagged.pdf', '_.pdf')
|
|
|
|
|
|
def test_force_tagged_warns(resources, outpdf, caplog):
|
|
caplog.set_level('WARNING')
|
|
ocrmypdf.ocr(
|
|
resources / 'tagged.pdf',
|
|
outpdf,
|
|
force_ocr=True,
|
|
plugins=['tests/plugins/tesseract_noop.py'],
|
|
)
|
|
assert 'marked as a Tagged PDF' in caplog.text
|