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

Method test_expat_inpsource_location

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

Source from the content-addressed store, hash-verified

1316
1317class ErrorReportingTest(unittest.TestCase):
1318 def test_expat_inpsource_location(self):
1319 parser = create_parser()
1320 parser.setContentHandler(ContentHandler()) # do nothing
1321 source = InputSource()
1322 source.setByteStream(BytesIO(b"<foo bar foobar>")) #ill-formed
1323 name = "a file name"
1324 source.setSystemId(name)
1325 try:
1326 parser.parse(source)
1327 self.fail()
1328 except SAXException as e:
1329 self.assertEqual(e.getSystemId(), name)
1330
1331 def test_expat_incomplete(self):
1332 parser = create_parser()

Callers

nothing calls this directly

Calls 11

setByteStreamMethod · 0.95
setSystemIdMethod · 0.95
create_parserFunction · 0.90
ContentHandlerClass · 0.90
InputSourceClass · 0.90
BytesIOClass · 0.90
setContentHandlerMethod · 0.45
parseMethod · 0.45
failMethod · 0.45
assertEqualMethod · 0.45
getSystemIdMethod · 0.45

Tested by

no test coverage detected