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

Method test_indent_space

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

Source from the content-addressed store, hash-verified

805 )
806
807 def test_indent_space(self):
808 elem = ET.XML("<html><body><p>pre<br/>post</p><p>text</p></body></html>")
809 ET.indent(elem, space='\t')
810 self.assertEqual(
811 ET.tostring(elem),
812 b'<html>\n'
813 b'\t<body>\n'
814 b'\t\t<p>pre<br />post</p>\n'
815 b'\t\t<p>text</p>\n'
816 b'\t</body>\n'
817 b'</html>'
818 )
819
820 elem = ET.XML("<html><body><p>pre<br/>post</p><p>text</p></body></html>")
821 ET.indent(elem, space='')
822 self.assertEqual(
823 ET.tostring(elem),
824 b'<html>\n'
825 b'<body>\n'
826 b'<p>pre<br />post</p>\n'
827 b'<p>text</p>\n'
828 b'</body>\n'
829 b'</html>'
830 )
831
832 def test_indent_space_caching(self):
833 elem = ET.XML("<html><body><p>par</p><p>text</p><p><br/></p><p /></body></html>")

Callers

nothing calls this directly

Calls 2

indentMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected