(self)
| 579 | self.assertEqual(result.getvalue(), self.xml("<doc> </doc>")) |
| 580 | |
| 581 | def test_xmlgen_encoding_bytes(self): |
| 582 | encodings = ('iso-8859-15', 'utf-8', 'utf-8-sig', |
| 583 | 'utf-16', 'utf-16be', 'utf-16le', |
| 584 | 'utf-32', 'utf-32be', 'utf-32le') |
| 585 | for encoding in encodings: |
| 586 | result = self.ioclass() |
| 587 | gen = XMLGenerator(result, encoding=encoding) |
| 588 | |
| 589 | gen.startDocument() |
| 590 | gen.startElement("doc", {"a": '\u20ac'}) |
| 591 | gen.characters("\u20ac".encode(encoding)) |
| 592 | gen.ignorableWhitespace(" ".encode(encoding)) |
| 593 | gen.endElement("doc") |
| 594 | gen.endDocument() |
| 595 | |
| 596 | self.assertEqual(result.getvalue(), |
| 597 | self.xml('<doc a="\u20ac">\u20ac </doc>', encoding=encoding)) |
| 598 | |
| 599 | def test_xmlgen_ns(self): |
| 600 | result = self.ioclass() |
nothing calls this directly
no test coverage detected