MCPcopy Create free account
hub / github.com/Python-Markdown/markdown / testTOCTitle

Method testTOCTitle

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

Source from the content-addressed store, hash-verified

411 )
412
413 def testTOCTitle(self):
414 self.assertMarkdownRenders(
415 self.dedent(
416 '''
417 # Header 1
418
419 ## Header 2
420 '''
421 ),
422 self.dedent(
423 '''
424 <h1 id="header-1">Header 1</h1>
425 <h2 id="header-2">Header 2</h2>
426 ''&#x27;
427 ),
428 expected_attrs={
429 'toc': (
430 '<div class="toc"><span class="toctitle">Table of Contents</span>'
431 '<ul>\n' # noqa
432 '<li><a href="#header-1">Header 1</a>' # noqa
433 '<ul>\n' # noqa
434 '<li><a href="#header-2">Header 2</a></li>\n' # noqa
435 '</ul>\n' # noqa
436 '</li>\n' # noqa
437 '</ul>\n' # noqa
438 '</div>\n'
439 )
440 },
441 extensions=[TocExtension(title='Table of Contents')]
442 )
443
444 def testTOCUniqueFunc(self):
445 ids = {'foo'}

Callers

nothing calls this directly

Calls 3

TocExtensionClass · 0.90
assertMarkdownRendersMethod · 0.80
dedentMethod · 0.80

Tested by

no test coverage detected