diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0f96a56..44cfce4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -45,4 +45,4 @@ jobs: run: tox -e ${{ matrix.env != env.PYTHON_LATEST_TAG && matrix.env || 'pandas' }} - name: Test pytesseract package installation if: ${{ matrix.env == env.PYTHON_LATEST_TAG }} - run: python -mpip install -U . && python -mpip show pytesseract && python -c 'import pytesseract' \ No newline at end of file + run: python -mpip install -U . && python -mpip show pytesseract && python -c 'import pytesseract' diff --git a/tests/pytesseract_test.py b/tests/pytesseract_test.py index 0afaa6e..3a54c71 100644 --- a/tests/pytesseract_test.py +++ b/tests/pytesseract_test.py @@ -27,6 +27,7 @@ from pytesseract import TesseractNotFoundError from pytesseract import TSVNotSupported from pytesseract.pytesseract import file_to_dict +from pytesseract.pytesseract import LANG_PATTERN from pytesseract.pytesseract import numpy_installed from pytesseract.pytesseract import pandas_installed from pytesseract.pytesseract import prepare @@ -518,3 +519,20 @@ def test_get_tesseract_version_invalid(tesseract_version, expected_msg): (msg,) = e.value.args assert msg == expected_msg + + +@pytest.mark.parametrize( + 'lang', + [ + 'bhu', + 'eng', + 'bhu_eng', + 'eng_bhu', + '7seg', + 'bhu32', + 'bhu32_7seg', + '7seg_eng', + ], +) +def test_allowed_language_formats(lang): + assert LANG_PATTERN.match(lang)