(self)
| 1316 | |
| 1317 | class 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() |
nothing calls this directly
no test coverage detected