MCPcopy Create free account
hub / github.com/RustPython/RustPython / test_basic

Method test_basic

Lib/test/test_pulldom.py:305–315  ·  view source on GitHub ↗

Ensure SAX2DOM can parse from a stream.

(self)

Source from the content-addressed store, hash-verified

303
304 @unittest.expectedFailure # TODO: RUSTPYTHON; read from stream io
305 def test_basic(self):
306 """Ensure SAX2DOM can parse from a stream."""
307 with io.StringIO(SMALL_SAMPLE) as fin:
308 sd = SAX2DOMTestHelper(fin, xml.sax.make_parser(),
309 len(SMALL_SAMPLE))
310 for evt, node in sd:
311 if evt == pulldom.START_ELEMENT and node.tagName == "html":
312 break
313 # Because the buffer is the same length as the XML, all the
314 # nodes should have been parsed and added:
315 self.assertGreater(len(node.childNodes), 0)
316
317 def testSAX2DOM(self):
318 """Ensure SAX2DOM expands nodes as expected."""

Callers

nothing calls this directly

Calls 4

SAX2DOMTestHelperClass · 0.85
lenFunction · 0.85
make_parserMethod · 0.80
assertGreaterMethod · 0.80

Tested by

no test coverage detected