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

Function test_remove_docs_drops_snapshot

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

Source from the content-addressed store, hash-verified

146
147
148def test_remove_docs_drops_snapshot(tmp_path: Path) -> None:
149 source = tmp_path / "source"
150 website = tmp_path / "docs-website"
151 _make_source_tree(source)
152 _make_docs_website_tree(website)
153
154 base = Namespace(
155 operation="sync",
156 source_root=source,
157 docs_website_root=website,
158 channel="version",
159 source_ref="v0.0.36",
160 version_slug="v0.0.36",
161 display_name="",
162 )
163 sdw.sync_docs(base)
164
165 fern = website / "fern"
166 assert (fern / "pages-v0.0.36").is_dir()
167 assert (fern / "versions" / "v0.0.36.yml").is_file()
168
169 sdw.remove_docs(
170 Namespace(
171 operation="remove",
172 source_root=None,
173 docs_website_root=website,
174 channel="version",
175 source_ref="",
176 version_slug="v0.0.36",
177 display_name="",
178 )
179 )
180
181 assert not (fern / "pages-v0.0.36").exists()
182 assert not (fern / "versions" / "v0.0.36.yml").exists()
183 docs_yml = read_yaml(fern / "docs.yml")
184 assert [entry["slug"] for entry in docs_yml["versions"]] == []

Callers

nothing calls this directly

Calls 4

_make_source_treeFunction · 0.85
_make_docs_website_treeFunction · 0.85
existsMethod · 0.80
read_yamlFunction · 0.70

Tested by

no test coverage detected