docs: output generated sources under docs/lib and docs/mcp
This commit is contained in:
@@ -11,7 +11,7 @@ def test_mcp_build(cli_runner):
|
||||
(pkg / "__init__.py").write_text("")
|
||||
(pkg / "mod.py").write_text("def f(): ...\n")
|
||||
|
||||
out_dir = cwd / "mcp_docs"
|
||||
out_dir = cwd / "docs" / "mcp"
|
||||
|
||||
result = cli_runner.invoke(
|
||||
cli,
|
||||
@@ -20,8 +20,6 @@ def test_mcp_build(cli_runner):
|
||||
"--mcp",
|
||||
"--module",
|
||||
"testpkg",
|
||||
"--out-dir",
|
||||
str(out_dir),
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@@ -33,8 +33,6 @@ def test_mkdocs_build_full_flow(
|
||||
"testpkg",
|
||||
"--site-name",
|
||||
"Test Site",
|
||||
"--docs-dir",
|
||||
"docs",
|
||||
"--mkdocs-yml",
|
||||
"mkdocs.yml",
|
||||
],
|
||||
@@ -43,7 +41,8 @@ def test_mkdocs_build_full_flow(
|
||||
assert result.exit_code == 0
|
||||
assert mock_mkdocs_build() is True
|
||||
assert (cwd / "mkdocs.yml").exists()
|
||||
assert (cwd / "docs" / "testpkg" / "mod.md").exists()
|
||||
assert (cwd / "docs" / "lib" / "testpkg" / "mod.md").exists()
|
||||
assert "docs_dir: docs/lib" in (cwd / "mkdocs.yml").read_text()
|
||||
|
||||
|
||||
def test_mkdocs_build_missing_module_fails(cli_runner):
|
||||
@@ -81,8 +80,6 @@ def test_mkdocs_build_without_site_name_uses_module_as_default_full_flow(
|
||||
"--mkdocs",
|
||||
"--module",
|
||||
"testpkg",
|
||||
"--docs-dir",
|
||||
"docs",
|
||||
"--mkdocs-yml",
|
||||
"mkdocs.yml",
|
||||
],
|
||||
@@ -99,5 +96,5 @@ def test_mkdocs_build_without_site_name_uses_module_as_default_full_flow(
|
||||
content = mkdocs_yml.read_text()
|
||||
assert "site_name: testpkg" in content
|
||||
|
||||
# Docs must be generated
|
||||
assert (cwd / "docs" / "testpkg" / "mod.md").exists()
|
||||
# Docs must be generated under the nested docs/lib dir
|
||||
assert (cwd / "docs" / "lib" / "testpkg" / "mod.md").exists()
|
||||
|
||||
Reference in New Issue
Block a user