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

Method testTOCTitle

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

TocExtensionClass · 0.90
assertMarkdownRendersMethod · 0.80
dedentMethod · 0.80

Tested by

no test coverage detected