(self)
| 238 | |
| 239 | @unittest.expectedFailure # TODO: RUSTPYTHON; AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing' |
| 240 | def test_parseString_bytes(self): |
| 241 | # UTF-8 is default encoding, US-ASCII is compatible with UTF-8, |
| 242 | # UTF-16 is autodetected |
| 243 | encodings = ('us-ascii', 'utf-8', 'utf-16', 'utf-16le', 'utf-16be') |
| 244 | for encoding in encodings: |
| 245 | self.check_parseString(xml_bytes(self.data, encoding)) |
| 246 | self.check_parseString(xml_bytes(self.data, encoding, None)) |
| 247 | # accept UTF-8 with BOM |
| 248 | self.check_parseString(xml_bytes(self.data, 'utf-8-sig', 'utf-8')) |
| 249 | self.check_parseString(xml_bytes(self.data, 'utf-8-sig', None)) |
| 250 | # accept data with declared encoding |
| 251 | self.check_parseString(xml_bytes(self.data, 'iso-8859-1')) |
| 252 | # fail on non-UTF-8 incompatible data without declared encoding |
| 253 | with self.assertRaises(SAXException): |
| 254 | self.check_parseString(xml_bytes(self.data, 'iso-8859-1', None)) |
| 255 | |
| 256 | class MakeParserTest(unittest.TestCase): |
| 257 | def test_make_parser2(self): |
nothing calls this directly
no test coverage detected