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

Method test_toxml_quote_text

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

Source from the content-addressed store, hash-verified

560 self.assertEqual(str, domstr)
561
562 def test_toxml_quote_text(self):
563 dom = Document()
564 elem = dom.appendChild(dom.createElement('elem'))
565 elem.appendChild(dom.createTextNode('&<>"'))
566 cr = elem.appendChild(dom.createElement('cr'))
567 cr.appendChild(dom.createTextNode('\r'))
568 crlf = elem.appendChild(dom.createElement('crlf'))
569 crlf.appendChild(dom.createTextNode('\r\n'))
570 lflf = elem.appendChild(dom.createElement('lflf'))
571 lflf.appendChild(dom.createTextNode('\n\n'))
572 ws = elem.appendChild(dom.createElement('ws'))
573 ws.appendChild(dom.createTextNode('\t\n\r '))
574 domstr = dom.toxml()
575 dom.unlink()
576 self.assertEqual(domstr, '<?xml version="1.0" ?>'
577 '<elem>&amp;&lt;&gt;"'
578 '<cr>\r</cr>'
579 '<crlf>\r\n</crlf>'
580 '<lflf>\n\n</lflf>'
581 '<ws>\t\n\r </ws></elem>')
582
583 def test_toxml_quote_attrib(self):
584 dom = Document()

Callers

nothing calls this directly

Calls 8

appendChildMethod · 0.95
createElementMethod · 0.95
createTextNodeMethod · 0.95
unlinkMethod · 0.95
DocumentClass · 0.90
toxmlMethod · 0.80
appendChildMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected