How to use the ocrd.cli.validate.validate_cli function in ocrd

To help you get started, we’ve selected a few ocrd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OCR-D / core / tests / cli / test_validate.py View on Github external
def test_validate_ocrd_tool(self):
        with TemporaryDirectory() as tempdir:
            json_path = Path(tempdir, 'ocrd-tool.json')
            json_path.write_text(OCRD_TOOL)

            # normal call
            result = self.runner.invoke(validate_cli, ['tool-json', str(json_path)])
            self.assertEqual(result.exit_code, 0)
            # relative path
            with pushd_popd(tempdir):
                result = self.runner.invoke(validate_cli, ['tool-json', 'ocrd-tool.json'])
                self.assertEqual(result.exit_code, 0)
            # default path
            with pushd_popd(tempdir):
                result = self.runner.invoke(validate_cli, ['tool-json'])
                self.assertEqual(result.exit_code, 0)
github OCR-D / core / tests / cli / test_validate.py View on Github external
def test_validate_parameter(self):
        with TemporaryDirectory() as tempdir:
            json_path = Path(tempdir, 'ocrd-tool.json')
            json_path.write_text(OCRD_TOOL)
            with pushd_popd(tempdir):
                result = self.runner.invoke(validate_cli, ['parameters', 'ocrd-tool.json', 'ocrd-xyz', dumps({"baz": "foo"})])
                self.assertEqual(result.exit_code, 0)
github OCR-D / core / ocrd / ocrd / cli / __init__.py View on Github external
from .log import log_cli

@click.group()
@click.version_option()
@ocrd_loglevel
def cli(**kwargs): # pylint: disable=unused-argument
    """
    CLI to OCR-D
    """

cli.add_command(ocrd_tool_cli)
cli.add_command(workspace_cli)
cli.add_command(process_cli)
cli.add_command(bashlib_cli)
cli.add_command(zip_cli)
cli.add_command(validate_cli)
cli.add_command(log_cli)