nav submodule
This commit is contained in:
37
tests/nav/test_mkdocs.py
Normal file
37
tests/nav/test_mkdocs.py
Normal file
@@ -0,0 +1,37 @@
|
||||
from pathlib import Path
|
||||
|
||||
from docforge.nav import ResolvedNav
|
||||
from docforge.nav import MkDocsNavEmitter
|
||||
|
||||
|
||||
def test_emit_mkdocs_nav():
|
||||
nav = ResolvedNav(
|
||||
home="openapi_first/index.md",
|
||||
groups={
|
||||
"Core": [
|
||||
Path("openapi_first/app.md"),
|
||||
Path("openapi_first/client.md"),
|
||||
],
|
||||
"CLI": [
|
||||
Path("openapi_first/cli.md"),
|
||||
],
|
||||
},
|
||||
)
|
||||
|
||||
emitter = MkDocsNavEmitter()
|
||||
mkdocs_nav = emitter.emit(nav)
|
||||
|
||||
assert mkdocs_nav == [
|
||||
{"Home": "openapi_first/index.md"},
|
||||
{
|
||||
"Core": [
|
||||
{"App": "openapi_first/app.md"},
|
||||
{"Client": "openapi_first/client.md"},
|
||||
]
|
||||
},
|
||||
{
|
||||
"CLI": [
|
||||
{"Cli": "openapi_first/cli.md"},
|
||||
]
|
||||
},
|
||||
]
|
||||
Reference in New Issue
Block a user