|
|
@ -6,6 +6,7 @@ from pathlib import Path
|
|
|
|
|
|
|
|
|
|
|
|
from click.testing import CliRunner
|
|
|
|
from click.testing import CliRunner
|
|
|
|
import pytest
|
|
|
|
import pytest
|
|
|
|
|
|
|
|
from .util import working_directory
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from ..ocrd_cli import ocrd_dinglehopper
|
|
|
|
from ..ocrd_cli import ocrd_dinglehopper
|
|
|
@ -13,19 +14,6 @@ from ..ocrd_cli import ocrd_dinglehopper
|
|
|
|
data_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data')
|
|
|
|
data_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class working_directory:
|
|
|
|
|
|
|
|
"""Context manager to temporarily change the working directory"""
|
|
|
|
|
|
|
|
def __init__(self, wd):
|
|
|
|
|
|
|
|
self.wd = wd
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def __enter__(self):
|
|
|
|
|
|
|
|
self.old_wd = os.getcwd()
|
|
|
|
|
|
|
|
os.chdir(self.wd)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def __exit__(self, etype, value, traceback):
|
|
|
|
|
|
|
|
os.chdir(self.old_wd)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_ocrd_cli(tmp_path):
|
|
|
|
def test_ocrd_cli(tmp_path):
|
|
|
|
"""Test OCR-D interface"""
|
|
|
|
"""Test OCR-D interface"""
|
|
|
|
|
|
|
|
|
|
|
|