generate test command fixed
This commit is contained in:
@@ -3,21 +3,24 @@ from pathlib import Path
|
|||||||
from docforge.cli.main import cli
|
from docforge.cli.main import cli
|
||||||
|
|
||||||
|
|
||||||
def test_generate_command(cli_runner, temp_package, tmp_path: Path):
|
def test_generate_command(cli_runner):
|
||||||
(temp_package / "mod.py").write_text(
|
with cli_runner.isolated_filesystem():
|
||||||
'''
|
cwd = Path.cwd()
|
||||||
def f(): ...
|
|
||||||
'''
|
|
||||||
)
|
|
||||||
|
|
||||||
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(
|
result = cli_runner.invoke(
|
||||||
cli,
|
cli,
|
||||||
[
|
[
|
||||||
"generate",
|
"generate",
|
||||||
"--modules",
|
"--module",
|
||||||
"testpkg.mod",
|
"testpkg",
|
||||||
"--docs-dir",
|
"--docs-dir",
|
||||||
str(docs_dir),
|
str(docs_dir),
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user