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

Method test_badbom

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

Source from the content-addressed store, hash-verified

666 self.assertEqual(f.read(), "spamspam")
667
668 def test_badbom(self):
669 s = io.BytesIO(b"\xff\xff")
670 f = codecs.getreader(self.encoding)(s)
671 self.assertRaises(UnicodeDecodeError, f.read)
672
673 s = io.BytesIO(b"\xff\xff\xff\xff")
674 f = codecs.getreader(self.encoding)(s)
675 self.assertRaises(UnicodeDecodeError, f.read)
676
677 def test_partial(self):
678 self.check_partial(

Callers

nothing calls this directly

Calls 2

getreaderMethod · 0.80
assertRaisesMethod · 0.45

Tested by

no test coverage detected