MCPcopy
hub / github.com/mkdocs/mkdocs / test_indented_toc

Method test_indented_toc

mkdocs/tests/structure/toc_tests.py:10–27  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

8
9class TableOfContentsTests(unittest.TestCase):
10 def test_indented_toc(self):
11 md = dedent(
12 """
13 # Heading 1
14 ## Heading 2
15 ### Heading 3
16 """
17 )
18 expected = dedent(
19 """
20 Heading 1 - #heading-1
21 Heading 2 - #heading-2
22 Heading 3 - #heading-3
23 """
24 )
25 toc = get_toc(get_markdown_toc(md))
26 self.assertEqual(str(toc).strip(), expected)
27 self.assertEqual(len(toc), 1)
28
29 def test_indented_toc_html(self):
30 md = dedent(

Callers

nothing calls this directly

Calls 3

dedentFunction · 0.90
get_tocFunction · 0.90
get_markdown_tocFunction · 0.90

Tested by

no test coverage detected