MCPcopy
hub / github.com/freedomofpress/dangerzone / test_ocr_ommisions

Function test_ocr_ommisions

tests/test_ocr.py:6–16  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4
5
6def test_ocr_ommisions() -> None:
7 # Grab the languages that are available in the Tesseract data dir.
8 suffix_len = len(".traineddata")
9 available_langs = {f.name[:-suffix_len] for f in get_tessdata_dir().iterdir()}
10
11 # Grab the languages that Dangerzone offers to the user through the GUI/CLI.
12 offered_langs = set(DangerzoneCore(Dummy()).ocr_languages.values())
13
14 # Ensure that both the available languages and the ones we offer to the user are the
15 # same.
16 assert available_langs == offered_langs

Callers

nothing calls this directly

Calls 3

get_tessdata_dirFunction · 0.90
DangerzoneCoreClass · 0.90
DummyClass · 0.90

Tested by

no test coverage detected