mirror of
https://github.com/qurator-spk/eynollah.git
synced 2025-06-09 12:19:54 +02:00
do an actual test run
This commit is contained in:
parent
3905203294
commit
4e1956df5e
5 changed files with 82 additions and 1 deletions
24
tests/test_run.py
Normal file
24
tests/test_run.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
from os import environ
|
||||
from pathlib import Path
|
||||
from ocrd_utils import pushd_popd
|
||||
from tests.base import CapturingTestCase as TestCase, main
|
||||
from sbb_newspapers_org_image.cli import main as eynollah_cli
|
||||
|
||||
testdir = Path(__file__).parent.resolve()
|
||||
|
||||
EYNOLLAH_MODELS = environ.get('EYNOLLAH_MODELS', str(testdir.joinpath('..', 'models_eynollah').resolve()))
|
||||
|
||||
class TestEynollahRun(TestCase):
|
||||
|
||||
def test_full_run(self):
|
||||
with pushd_popd(tempdir=True) as tempdir:
|
||||
code, out, err = self.invoke_cli(eynollah_cli, [
|
||||
'-m', EYNOLLAH_MODELS,
|
||||
'-i', str(testdir.joinpath('resources/kant_aufklaerung_1784_0020.tif')),
|
||||
'-o', tempdir
|
||||
])
|
||||
print(code, out, err)
|
||||
assert not code
|
||||
|
||||
if __name__ == '__main__':
|
||||
main(__file__)
|
Loading…
Add table
Add a link
Reference in a new issue