added cli
This commit is contained in:
32
tests/cli/test_generate.py
Normal file
32
tests/cli/test_generate.py
Normal 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
|
||||
Reference in New Issue
Block a user