From fca08ca35509fdc344db985f2c655561444fa38d Mon Sep 17 00:00:00 2001 From: Michele Dolfi Date: Thu, 12 Sep 2024 16:44:07 +0200 Subject: [PATCH] add tests for CLI Signed-off-by: Michele Dolfi --- tests/test_cli.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tests/test_cli.py diff --git a/tests/test_cli.py b/tests/test_cli.py new file mode 100644 index 00000000..48f863a6 --- /dev/null +++ b/tests/test_cli.py @@ -0,0 +1,20 @@ +from typer.testing import CliRunner + +from docling.cli.main import app + +runner = CliRunner() + + +def test_cli_help(): + result = runner.invoke(app, ["--help"]) + assert result.exit_code == 0 + + +def test_cli_version(): + result = runner.invoke(app, ["--version"]) + assert result.exit_code == 0 + + +def test_cli_convert(): + result = runner.invoke(app, ["./tests/data/2305.03393v1-pg9.pdf"]) + assert result.exit_code == 0