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

Method test_parseString_bytes

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

Source from the content-addressed store, hash-verified

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
256class MakeParserTest(unittest.TestCase):
257 def test_make_parser2(self):

Callers

nothing calls this directly

Calls 3

check_parseStringMethod · 0.95
xml_bytesFunction · 0.85
assertRaisesMethod · 0.45

Tested by

no test coverage detected