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

Method testReadMonkeyMultiStream

Lib/test/test_bz2.py:136–147  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

134 self.assertEqual(bz2f.read(), self.TEXT * 5)
135
136 def testReadMonkeyMultiStream(self):
137 # Test BZ2File.read() on a multi-stream archive where a stream
138 # boundary coincides with the end of the raw read buffer.
139 buffer_size = _streams.BUFFER_SIZE
140 _streams.BUFFER_SIZE = len(self.DATA)
141 try:
142 self.createTempFile(streams=5)
143 with BZ2File(self.filename) as bz2f:
144 self.assertRaises(TypeError, bz2f.read, float())
145 self.assertEqual(bz2f.read(), self.TEXT * 5)
146 finally:
147 _streams.BUFFER_SIZE = buffer_size
148
149 def testReadTrailingJunk(self):
150 self.createTempFile(suffix=self.BAD_DATA)

Callers

nothing calls this directly

Calls 5

createTempFileMethod · 0.95
BZ2FileClass · 0.90
assertRaisesMethod · 0.45
assertEqualMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected