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

Method test_parse_close_source

Lib/test/test_sax.py:209–222  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

207
208 @unittest.expectedFailure # TODO: RUSTPYTHON; AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'
209 def test_parse_close_source(self):
210 builtin_open = open
211 fileobj = None
212
213 def mock_open(*args):
214 nonlocal fileobj
215 fileobj = builtin_open(*args)
216 return fileobj
217
218 with mock.patch('xml.sax.saxutils.open', side_effect=mock_open):
219 make_xml_file(self.data, 'iso-8859-1', None)
220 with self.assertRaises(SAXException):
221 self.check_parse(TESTFN)
222 self.assertTrue(fileobj.closed)
223
224 @unittest.expectedFailure # TODO: RUSTPYTHON; AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'
225 def check_parseString(self, s):

Callers

nothing calls this directly

Calls 4

check_parseMethod · 0.95
make_xml_fileFunction · 0.85
assertTrueMethod · 0.80
assertRaisesMethod · 0.45

Tested by

no test coverage detected