MCPcopy
hub / github.com/mkdocs/mkdocs / test_flat_toc

Method test_flat_toc

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

Source from the content-addressed store, hash-verified

46 self.assertEqual(len(toc), 1)
47
48 def test_flat_toc(self):
49 md = dedent(
50 """
51 # Heading 1
52 # Heading 2
53 # Heading 3
54 """
55 )
56 expected = dedent(
57 """
58 Heading 1 - #heading-1
59 Heading 2 - #heading-2
60 Heading 3 - #heading-3
61 """
62 )
63 toc = get_toc(get_markdown_toc(md))
64 self.assertEqual(str(toc).strip(), expected)
65 self.assertEqual(len(toc), 3)
66
67 def test_flat_h2_toc(self):
68 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