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

Method testParseDocument

tests/test_apis.py:159–168  ·  view source on GitHub ↗

Test `BlockParser.parseDocument`.

(self)

Source from the content-addressed store, hash-verified

157 )
158
159 def testParseDocument(self):
160 """ Test `BlockParser.parseDocument`. """
161 lines = ['#foo', '', 'bar', '', ' baz']
162 tree = self.parser.parseDocument(lines)
163 self.assertIsInstance(tree, etree.ElementTree)
164 self.assertIs(etree.iselement(tree.getroot()), True)
165 self.assertEqual(
166 markdown.serializers.to_xhtml_string(tree.getroot()),
167 "<div><h1>foo</h1><p>bar</p><pre><code>baz\n</code></pre></div>"
168 )
169
170
171class TestBlockParserState(unittest.TestCase):

Callers

nothing calls this directly

Calls 1

parseDocumentMethod · 0.80

Tested by

no test coverage detected