MCPcopy Index your code
hub / github.com/python/cpython / test_cdata_section

Method test_cdata_section

Lib/test/test_htmlparser.py:984–1000  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

982 self._run_check(html, expected, collector=EventCollector(autocdata=True))
983
984 def test_cdata_section(self):
985 # See "13.2.5.42 Markup declaration open state".
986 html = ('<![CDATA[foo<br>bar]]>'
987 '<svg><text y="100"><![CDATA[foo<br>bar]]></text></svg>'
988 '<![CDATA[foo<br>bar]]>')
989 expected = [
990 ('comment', '[CDATA[foo<br'),
991 ('data', 'bar]]>'),
992 ('starttag', 'svg', []),
993 ('starttag', 'text', [('y', '100')]),
994 ('unknown decl', 'CDATA[foo<br>bar'),
995 ('endtag', 'text'),
996 ('endtag', 'svg'),
997 ('comment', '[CDATA[foo<br'),
998 ('data', 'bar]]>'),
999 ]
1000 self._run_check(html, expected, collector=EventCollector(autocdata=True))
1001
1002 def test_convert_charrefs_dropped_text(self):
1003 # #23144: make sure that all the events are triggered when

Callers

nothing calls this directly

Calls 2

EventCollectorClass · 0.85
_run_checkMethod · 0.80

Tested by

no test coverage detected