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

Method test_badbom

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

getreaderMethod · 0.80
assertRaisesMethod · 0.45

Tested by

no test coverage detected