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

Method test_badbom

Lib/test/test_codecs.py:483–490  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

481 self.assertEqual(f.read(), "spamspam")
482
483 def test_badbom(self):
484 s = io.BytesIO(4*b"\xff")
485 f = codecs.getreader(self.encoding)(s)
486 self.assertRaises(UnicodeDecodeError, f.read)
487
488 s = io.BytesIO(8*b"\xff")
489 f = codecs.getreader(self.encoding)(s)
490 self.assertRaises(UnicodeDecodeError, f.read)
491
492 def test_partial(self):
493 self.check_partial(

Callers

nothing calls this directly

Calls 2

getreaderMethod · 0.80
assertRaisesMethod · 0.45

Tested by

no test coverage detected