generate test command fixed

This commit is contained in:
2026-01-20 23:59:51 +05:30
parent b497c5d2e9
commit 5c8d9dcc9c

View File

@@ -3,21 +3,24 @@ 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(): ...
'''
)
def test_generate_command(cli_runner):
with cli_runner.isolated_filesystem():
cwd = Path.cwd()
docs_dir = tmp_path / "docs"
# Create package structure
pkg = cwd / "testpkg"
pkg.mkdir()
(pkg / "__init__.py").write_text("")
(pkg / "mod.py").write_text("def f(): ...\n")
docs_dir = cwd / "docs"
result = cli_runner.invoke(
cli,
[
"generate",
"--modules",
"testpkg.mod",
"--module",
"testpkg",
"--docs-dir",
str(docs_dir),
],