Files
doc-forge/tests/renderers/mkdocs/test_mkdocs_module_coverage.py
Vishesh 'ironeagle' Bangotra 06ffd2febd chore(release): 0.0.7
Squash-merge lib-standardisation: adopt repo standards across packaging,
tooling, docs, and CI.

- standardize pyproject.toml (canonical packaging, lint config, extras, GSDFC pydoclint)
- add py.typed marker, modernize type hints and Google-style docstrings
- nest generated docs under docs/lib and docs/mcp; add hand-written wiki
- adopt standard Type A PyPI CI pipeline (tag==version guard + quality gate)
- promote generated CHANGELOG.md; bump version to 0.0.7
2026-10-17 02:16:44 +05:30

49 lines
1.4 KiB
Python

from pathlib import Path
from docforge import MkDocsRenderer
from docforge.loaders import GriffeLoader, discover_module_paths
def test_mkdocs_emits_all_modules(tmp_path: Path) -> None:
project_root = Path(__file__).resolve().parents[3]
loader = GriffeLoader()
discovered_paths = discover_module_paths(
"docforge",
project_root=project_root,
)
project = loader.load_project(discovered_paths)
renderer = MkDocsRenderer()
renderer.generate_sources(project, tmp_path)
renderer.generate_readme(
project,
tmp_path,
module_is_source=True,
)
emitted = {p.relative_to(tmp_path).as_posix() for p in tmp_path.rglob("*.md")}
module_paths = [m.path for m in project.get_all_modules()]
expected = set()
for path in module_paths:
parts = path.split(".")
is_package = any(
other != path and other.startswith(path + ".") for other in module_paths
)
if is_package:
expected.add("/".join(parts) + "/index.md")
else:
expected.add("/".join(parts) + ".md")
missing = expected - emitted
assert not missing, f"Missing markdown files for modules: {missing}"
readme = tmp_path.parent / "README.md"
assert readme.exists(), "README.md was not generated"
content = readme.read_text(encoding="utf-8")
assert project.name in content