MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_parse

Method test_parse

Lib/test/test_pulldom.py:28–42  ·  view source on GitHub ↗

Minimal test of DOMEventStream.parse()

(self)

Source from the content-addressed store, hash-verified

26
27 @unittest.expectedFailure # TODO: RUSTPYTHON; FileNotFoundError: [Errno 2] No such file or directory (os error 2): 'xmltestdata/test.xml' -> 'None'
28 def test_parse(self):
29 """Minimal test of DOMEventStream.parse()"""
30
31 # This just tests that parsing from a stream works. Actual parser
32 # semantics are tested using parseString with a more focused XML
33 # fragment.
34
35 # Test with a filename:
36 handler = pulldom.parse(tstfile)
37 self.addCleanup(handler.stream.close)
38 list(handler)
39
40 # Test with a file object:
41 with open(tstfile, "rb") as fin:
42 list(pulldom.parse(fin))
43
44 @unittest.expectedFailure # TODO: RUSTPYTHON; implement DOM semantic
45 def test_parse_semantics(self):

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