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

Method test_toxml_quote_text

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

Source from the content-addressed store, hash-verified

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