MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_short_empty_elements

Method test_short_empty_elements

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

Source from the content-addressed store, hash-verified

4416 b''.join(ET.tostringlist(root, 'utf-16')))
4417
4418 def test_short_empty_elements(self):
4419 root = ET.fromstring('<tag>a<x />b<y></y>c</tag>')
4420 self.assertEqual(
4421 ET.tostring(root, 'unicode'),
4422 '<tag>a<x />b<y />c</tag>')
4423 self.assertEqual(
4424 ET.tostring(root, 'unicode', short_empty_elements=True),
4425 '<tag>a<x />b<y />c</tag>')
4426 self.assertEqual(
4427 ET.tostring(root, 'unicode', short_empty_elements=False),
4428 '<tag>a<x></x>b<y></y>c</tag>')
4429
4430
4431class ParseErrorTest(unittest.TestCase):

Callers

nothing calls this directly

Calls 2

fromstringMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected