Skip to content

Commit

Permalink
test: generate file from CLI in a temporary directory
Browse files Browse the repository at this point in the history
Signed-off-by: Cesar Berrospi Ramis <[email protected]>
  • Loading branch information
ceberam committed Dec 17, 2024
1 parent 3e599c7 commit e8248a8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from pathlib import Path

from typer.testing import CliRunner

from docling.cli.main import app
Expand All @@ -15,6 +17,11 @@ def test_cli_version():
assert result.exit_code == 0


def test_cli_convert():
result = runner.invoke(app, ["./tests/data/2305.03393v1-pg9.pdf"])
def test_cli_convert(tmp_path):
source = "./tests/data/2305.03393v1-pg9.pdf"
output = tmp_path / "out"
output.mkdir()
result = runner.invoke(app, [source, "--output", str(output)])
assert result.exit_code == 0
converted = output / f"{Path(source).stem}.md"
assert converted.exists()

0 comments on commit e8248a8

Please sign in to comment.