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

Function test_prefix_navigation_paths

tasks/scripts/sync_docs_website_test.py:68–88  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

66
67
68def test_prefix_navigation_paths() -> None:
69 nav: dict[str, object] = {
70 "navigation": [
71 {"page": "Intro", "path": "intro.mdx"},
72 {
73 "section": "Guide",
74 "folder": "guide",
75 "contents": [{"path": "guide/a.mdx"}],
76 },
77 {"page": "External", "path": "https://example.com"},
78 ]
79 }
80 sdw.prefix_navigation_paths(nav, "pages-dev")
81 navigation = cast("list[dict[str, object]]", nav["navigation"])
82 guide = navigation[1]
83 contents = cast("list[dict[str, object]]", guide["contents"])
84 assert navigation[0]["path"] == "../pages-dev/intro.mdx"
85 assert guide["folder"] == "../pages-dev/guide"
86 assert contents[0]["path"] == "../pages-dev/guide/a.mdx"
87 # Absolute URLs are left untouched.
88 assert navigation[2]["path"] == "https://example.com"
89
90
91def _make_source_tree(root: Path) -> None:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected