MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / test_sync_docs_creates_snapshot

Function test_sync_docs_creates_snapshot

tasks/scripts/sync_docs_website_test.py:116–145  ·  view source on GitHub ↗
(tmp_path: Path)

Source from the content-addressed store, hash-verified

114
115
116def test_sync_docs_creates_snapshot(tmp_path: Path) -> None:
117 source = tmp_path / "source"
118 website = tmp_path / "docs-website"
119 _make_source_tree(source)
120 _make_docs_website_tree(website)
121
122 sdw.sync_docs(
123 Namespace(
124 operation="sync",
125 source_root=source,
126 docs_website_root=website,
127 channel="dev",
128 source_ref="main",
129 version_slug="",
130 display_name="",
131 )
132 )
133
134 fern = website / "fern"
135 assert (fern / "pages-dev" / "intro.mdx").is_file()
136 assert (fern / "assets" / "logo.svg").is_file()
137
138 version_nav = read_yaml(fern / "versions" / "dev.yml")
139 assert version_nav["navigation"][0]["path"] == "../pages-dev/intro.mdx"
140
141 docs_yml = read_yaml(fern / "docs.yml")
142 slugs = [entry["slug"] for entry in docs_yml["versions"]]
143 assert slugs == ["dev"]
144 assert docs_yml["versions"][0]["path"] == "./versions/dev.yml"
145 assert "./components" in docs_yml["experimental"]["mdx-components"]
146
147
148def test_remove_docs_drops_snapshot(tmp_path: Path) -> None:

Callers

nothing calls this directly

Calls 3

_make_source_treeFunction · 0.85
_make_docs_website_treeFunction · 0.85
read_yamlFunction · 0.70

Tested by

no test coverage detected