feat: use file-wins mkdocs configs with --refresh; wiki template in mongo-ops style
This commit is contained in:
@@ -111,6 +111,33 @@ def test_wiki_without_module_flag_ok(
|
||||
assert mock_mkdocs_build() is True
|
||||
|
||||
|
||||
def test_wiki_existing_config_used_verbatim_without_refresh(
|
||||
cli_runner,
|
||||
mock_mkdocs_build,
|
||||
mock_mkdocs_load_config,
|
||||
):
|
||||
with cli_runner.isolated_filesystem():
|
||||
cwd = Path.cwd()
|
||||
|
||||
wiki = cwd / "docs" / "wiki"
|
||||
wiki.mkdir(parents=True)
|
||||
(wiki / "index.md").write_text("# Home", encoding="utf-8")
|
||||
|
||||
config = cwd / "docs" / "mkdocs.wiki.yml"
|
||||
sentinel = "site_name: Custom Wiki\nnav: []\n"
|
||||
config.write_text(sentinel, encoding="utf-8")
|
||||
|
||||
result = cli_runner.invoke(
|
||||
cli,
|
||||
["build", "--wiki", "--site-name", "Wiki Site"],
|
||||
)
|
||||
|
||||
assert result.exit_code == 0, result.output
|
||||
assert mock_mkdocs_build() is True
|
||||
assert config.read_text(encoding="utf-8") == sentinel
|
||||
assert "Using existing MkDocs config" in result.output
|
||||
|
||||
|
||||
def test_missing_wiki_dir_errors(cli_runner, mock_mkdocs_build):
|
||||
with cli_runner.isolated_filesystem():
|
||||
cwd = Path.cwd()
|
||||
|
||||
Reference in New Issue
Block a user