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

Method test_xmlgen_encoding

Lib/test/test_sax.py:535–550  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

533 "<e a=\"&#10;&#13;&#9;\"></e></doc>"))
534
535 def test_xmlgen_encoding(self):
536 encodings = ('iso-8859-15', 'utf-8', 'utf-8-sig',
537 'utf-16', 'utf-16be', 'utf-16le',
538 'utf-32', 'utf-32be', 'utf-32le')
539 for encoding in encodings:
540 result = self.ioclass()
541 gen = XMLGenerator(result, encoding=encoding)
542
543 gen.startDocument()
544 gen.startElement("doc", {"a": '\u20ac'})
545 gen.characters("\u20ac")
546 gen.endElement("doc")
547 gen.endDocument()
548
549 self.assertEqual(result.getvalue(),
550 self.xml('<doc a="\u20ac">\u20ac</doc>', encoding=encoding))
551
552 def test_xmlgen_unencodable(self):
553 result = self.ioclass()

Callers

nothing calls this directly

Calls 10

startDocumentMethod · 0.95
startElementMethod · 0.95
charactersMethod · 0.95
endElementMethod · 0.95
endDocumentMethod · 0.95
XMLGeneratorClass · 0.90
ioclassMethod · 0.45
assertEqualMethod · 0.45
getvalueMethod · 0.45
xmlMethod · 0.45

Tested by

no test coverage detected