2023-10-17 01:58:37 -07:00
|
|
|
# SPDX-FileCopyrightText: 2023 James R. Barlow
|
|
|
|
# SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
|
|
|
from __future__ import annotations
|
|
|
|
|
2023-10-30 00:33:21 -07:00
|
|
|
import pytest
|
|
|
|
|
2023-10-17 01:58:37 -07:00
|
|
|
from ocrmypdf.exceptions import ExitCode
|
|
|
|
|
2023-10-30 00:33:21 -07:00
|
|
|
from .conftest import is_linux, run_ocrmypdf_api
|
2023-10-17 01:58:37 -07:00
|
|
|
|
|
|
|
|
2023-10-30 00:33:21 -07:00
|
|
|
@pytest.mark.skipif(not is_linux(), reason='semfree plugin only works on Linux')
|
2023-10-17 01:58:37 -07:00
|
|
|
def test_semfree(resources, outpdf):
|
|
|
|
exitcode = run_ocrmypdf_api(
|
|
|
|
resources / 'multipage.pdf',
|
|
|
|
outpdf,
|
|
|
|
'--skip-text',
|
|
|
|
'--skip-big',
|
|
|
|
'2',
|
|
|
|
'--plugin',
|
|
|
|
'ocrmypdf.extra_plugins.semfree',
|
|
|
|
'--plugin',
|
|
|
|
'tests/plugins/tesseract_noop.py',
|
|
|
|
)
|
2024-05-21 01:26:11 -07:00
|
|
|
assert exitcode in (ExitCode.ok, ExitCode.pdfa_conversion_failed)
|