Ensure SAX2DOM can parse from a stream.
(self)
| 299 | self.assertTrue(test, testname) |
| 300 | |
| 301 | def test_basic(self): |
| 302 | """Ensure SAX2DOM can parse from a stream.""" |
| 303 | with io.StringIO(SMALL_SAMPLE) as fin: |
| 304 | sd = SAX2DOMTestHelper(fin, xml.sax.make_parser(), |
| 305 | len(SMALL_SAMPLE)) |
| 306 | for evt, node in sd: |
| 307 | if evt == pulldom.START_ELEMENT and node.tagName == "html": |
| 308 | break |
| 309 | # Because the buffer is the same length as the XML, all the |
| 310 | # nodes should have been parsed and added: |
| 311 | self.assertGreater(len(node.childNodes), 0) |
| 312 | |
| 313 | def testSAX2DOM(self): |
| 314 | """Ensure SAX2DOM expands nodes as expected.""" |
nothing calls this directly
no test coverage detected