added cli

This commit is contained in:
2026-01-20 20:47:28 +05:30
parent 7c027834c0
commit 8b2d6a5046
13 changed files with 390 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
from pathlib import Path
from docforge.cli.main import cli
def test_generate_command(cli_runner, temp_package, tmp_path: Path):
(temp_package / "mod.py").write_text(
'''
def f(): ...
'''
)
docs_dir = tmp_path / "docs"
result = cli_runner.invoke(
cli,
[
"generate",
"--modules",
"testpkg.mod",
"--docs-dir",
str(docs_dir),
],
)
assert result.exit_code == 0
md = docs_dir / "testpkg" / "mod.md"
assert md.exists()
content = md.read_text()
assert "::: testpkg.mod" in content