MCPcopy Create free account
hub / github.com/python/cpython / test_toxml_quote_attrib

Method test_toxml_quote_attrib

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

Source from the content-addressed store, hash-verified

581 '<ws>\t\n\r </ws></elem>')
582
583 def test_toxml_quote_attrib(self):
584 dom = Document()
585 elem = dom.appendChild(dom.createElement('elem'))
586 elem.setAttribute("a", '&<>"')
587 elem.setAttribute("cr", "\r")
588 elem.setAttribute("lf", "\n")
589 elem.setAttribute("crlf", "\r\n")
590 elem.setAttribute("lflf", "\n\n")
591 elem.setAttribute("ws", "\t\n\r ")
592 domstr = dom.toxml()
593 dom.unlink()
594 self.assertEqual(domstr, '<?xml version="1.0" ?>'
595 '<elem a="&amp;&lt;&gt;&quot;" '
596 'cr="&#13;" '
597 'lf="&#10;" '
598 'crlf="&#13;&#10;" '
599 'lflf="&#10;&#10;" '
600 'ws="&#9;&#10;&#13; "/>')
601
602 def testAltNewline(self):
603 str = '<?xml version="1.0" ?>\n<a b="c"/>\n'

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected