do an actual test run

This commit is contained in:
Konstantin Baierer 2021-02-04 15:21:14 +01:00
parent 3905203294
commit 4e1956df5e
5 changed files with 82 additions and 1 deletions

24
tests/test_run.py Normal file
View 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__)