MCPcopy Index your code
hub / github.com/python/cpython / test_basic

Method test_basic

Lib/test/test_pulldom.py:301–311  ·  view source on GitHub ↗

Ensure SAX2DOM can parse from a stream.

(self)

Source from the content-addressed store, hash-verified

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."""

Callers

nothing calls this directly

Calls 3

SAX2DOMTestHelperClass · 0.85
make_parserMethod · 0.80
assertGreaterMethod · 0.80

Tested by

no test coverage detected