MCPcopy Index your code
hub / github.com/Python-Markdown/markdown / testTOCTitle

Method testTOCTitle

tests/test_syntax/extensions/test_toc.py:365–394  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

363 )
364
365 def testTOCTitle(self):
366 self.assertMarkdownRenders(
367 self.dedent(
368 '''
369 # Header 1
370
371 ## Header 2
372 '''
373 ),
374 self.dedent(
375 '''
376 <h1 id="header-1">Header 1</h1>
377 <h2 id="header-2">Header 2</h2>
378 ''&#x27;
379 ),
380 expected_attrs={
381 'toc': (
382 '<div class="toc"><span class="toctitle">Table of Contents</span>'
383 '<ul>\n' # noqa
384 '<li><a href="#header-1">Header 1</a>' # noqa
385 '<ul>\n' # noqa
386 '<li><a href="#header-2">Header 2</a></li>\n' # noqa
387 '</ul>\n' # noqa
388 '</li>\n' # noqa
389 '</ul>\n' # noqa
390 '</div>\n'
391 )
392 },
393 extensions=[TocExtension(title='Table of Contents')]
394 )
395
396 def testTOCUniqueFunc(self):
397 ids = {'foo'}

Callers

nothing calls this directly

Calls 3

TocExtensionClass · 0.90
assertMarkdownRendersMethod · 0.80
dedentMethod · 0.80

Tested by

no test coverage detected