Files
SnapOtter/packages/ai/python/tests/test_ocr_runtime_isolation.py
T
SnapOtterandGitHub 991c981529 fix: make OCR portable and reliable across AMD64 and ARM64 (#519)
* fix: make OCR portable and reliable

* fix: harden OCR installation portability

* fix: pin OCR partials across downloads

* fix: make OCR execution reliably asynchronous

* fix: harden OCR portability and docs routes

* fix: preserve decoder and docs safeguards
2026-07-15 03:34:24 +08:00

19 lines
660 B
Python

"""Accurate OCR must never re-enter the mutable legacy Python dispatcher."""
from pathlib import Path
from packages.ai.python import dispatcher
def test_legacy_dispatcher_does_not_allow_ocr_scripts():
assert "ocr" not in dispatcher.ALLOWED_SCRIPTS
assert "ocr_pdf" not in dispatcher.ALLOWED_SCRIPTS
def test_shared_requirements_do_not_install_paddle():
python_root = Path(__file__).resolve().parents[1]
for name in ("requirements.txt", "requirements-gpu.txt"):
requirements = (python_root / name).read_text(encoding="utf-8").lower()
assert "paddleocr" not in requirements
assert "paddlepaddle" not in requirements