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

Method test_toprettyxml_with_text_nodes

Lib/test/test_minidom.py:609–621  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

607 self.assertEqual(domstr, str.replace("\n", "\r\n"))
608
609 def test_toprettyxml_with_text_nodes(self):
610 # see issue #4147, text nodes are not indented
611 decl = '<?xml version="1.0" ?>\n'
612 self.assertEqual(parseString('<B>A</B>').toprettyxml(),
613 decl + '<B>A</B>\n')
614 self.assertEqual(parseString('<C>A<B>A</B></C>').toprettyxml(),
615 decl + '<C>\n\tA\n\t<B>A</B>\n</C>\n')
616 self.assertEqual(parseString('<C><B>A</B>A</C>').toprettyxml(),
617 decl + '<C>\n\t<B>A</B>\n\tA\n</C>\n')
618 self.assertEqual(parseString('<C><B>A</B><B>A</B></C>').toprettyxml(),
619 decl + '<C>\n\t<B>A</B>\n\t<B>A</B>\n</C>\n')
620 self.assertEqual(parseString('<C><B>A</B>A<B>A</B></C>').toprettyxml(),
621 decl + '<C>\n\t<B>A</B>\n\tA\n\t<B>A</B>\n</C>\n')
622
623 def test_toprettyxml_with_adjacent_text_nodes(self):
624 # see issue #4147, adjacent text nodes are indented normally

Callers

nothing calls this directly

Calls 3

parseStringFunction · 0.90
toprettyxmlMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected