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

Method test_short_empty_elements

Lib/test/test_xml_etree.py:4455–4465  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4453 b''.join(ET.tostringlist(root, 'utf-16')))
4454
4455 def test_short_empty_elements(self):
4456 root = ET.fromstring('<tag>a<x />b<y></y>c</tag>')
4457 self.assertEqual(
4458 ET.tostring(root, 'unicode'),
4459 '<tag>a<x />b<y />c</tag>')
4460 self.assertEqual(
4461 ET.tostring(root, 'unicode', short_empty_elements=True),
4462 '<tag>a<x />b<y />c</tag>')
4463 self.assertEqual(
4464 ET.tostring(root, 'unicode', short_empty_elements=False),
4465 '<tag>a<x></x>b<y></y>c</tag>')
4466
4467
4468class ParseErrorTest(unittest.TestCase):

Callers

nothing calls this directly

Calls 2

fromstringMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected