You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
eynollah/tests/test_run.py

25 lines
811 B
Python

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__)