tests: little fixes

This commit is contained in:
James R. Barlow
2026-01-20 23:23:43 -08:00
parent bd29269c00
commit ec595a395b
4 changed files with 38 additions and 12 deletions
+11
View File
@@ -49,6 +49,17 @@ def check_platform() -> None:
def check_options_languages(
options: OcrOptions, ocr_engine_languages: list[str]
) -> None:
# Check for blocked languages first, before checking if they're installed
DENIED_LANGUAGES = {'equ', 'osd'}
blocked = DENIED_LANGUAGES & set(options.languages)
if blocked:
raise BadArgsError(
"The following languages are for Tesseract's internal use and "
"should not be issued explicitly: "
f"{', '.join(blocked)}\n"
"Remove them from the -l/--language argument."
)
if not ocr_engine_languages:
return