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

Method test_parse

Lib/test/test_pulldom.py:27–41  ·  view source on GitHub ↗

Minimal test of DOMEventStream.parse()

(self)

Source from the content-addressed store, hash-verified

25class PullDOMTestCase(unittest.TestCase):
26
27 def test_parse(self):
28 """Minimal test of DOMEventStream.parse()"""
29
30 # This just tests that parsing from a stream works. Actual parser
31 # semantics are tested using parseString with a more focused XML
32 # fragment.
33
34 # Test with a filename:
35 handler = pulldom.parse(tstfile)
36 self.addCleanup(handler.stream.close)
37 list(handler)
38
39 # Test with a file object:
40 with open(tstfile, "rb") as fin:
41 list(pulldom.parse(fin))
42
43 def test_parse_semantics(self):
44 """Test DOMEventStream parsing semantics."""

Callers

nothing calls this directly

Calls 4

listClass · 0.85
addCleanupMethod · 0.80
openFunction · 0.50
parseMethod · 0.45

Tested by

no test coverage detected