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

Method test_expat_incremental_reset

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

Source from the content-addressed store, hash-verified

1196 self.assertEqual(result.getvalue(), start + b"<doc></doc>")
1197
1198 def test_expat_incremental_reset(self):
1199 result = BytesIO()
1200 xmlgen = XMLGenerator(result)
1201 parser = create_parser()
1202 parser.setContentHandler(xmlgen)
1203
1204 parser.feed("<doc>")
1205 parser.feed("text")
1206
1207 result = BytesIO()
1208 xmlgen = XMLGenerator(result)
1209 parser.setContentHandler(xmlgen)
1210 parser.reset()
1211
1212 parser.feed("<doc>")
1213 parser.feed("text")
1214 parser.feed("</doc>")
1215 parser.close()
1216
1217 self.assertEqual(result.getvalue(), start + b"<doc>text</doc>")
1218
1219 @unittest.skipIf(pyexpat.version_info < (2, 6, 0),
1220 f'Expat {pyexpat.version_info} does not '

Callers

nothing calls this directly

Calls 9

getvalueMethod · 0.95
BytesIOClass · 0.90
XMLGeneratorClass · 0.90
create_parserFunction · 0.90
setContentHandlerMethod · 0.45
feedMethod · 0.45
resetMethod · 0.45
closeMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected