def test_filter_basic(self): result = BytesIO() gen = XMLGenerator(result) filter = XMLFilterBase() filter.setContentHandler(gen) filter.startDocument() filter.startElement('doc', {}) filter.characters('content') filter.ignorableWhitespace(' ') filter.endElement('doc') filter.endDocument() self.assertEqual(result.getvalue(), start + b'<doc>content </doc>')
def test_filter_basic(): result = StringIO() gen = XMLGenerator(result) filter = XMLFilterBase() filter.setContentHandler(gen) filter.startDocument() filter.startElement("doc", {}) filter.characters("content") filter.ignorableWhitespace(" ") filter.endElement("doc") filter.endDocument() return result.getvalue() == start + "<doc>content </doc>"
def test_filter_basic(self): result = BytesIO() gen = XMLGenerator(result) filter = XMLFilterBase() filter.setContentHandler(gen) filter.startDocument() filter.startElement("doc", {}) filter.characters("content") filter.ignorableWhitespace(" ") filter.endElement("doc") filter.endDocument() self.assertEqual(result.getvalue(), start + b"<doc>content </doc>")
# regression test for SAX 2.0