()
| 66 | |
| 67 | |
| 68 | def 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 | |
| 91 | def _make_source_tree(root: Path) -> None: |
nothing calls this directly
no outgoing calls
no test coverage detected