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

Method testReadMonkeyMultiStream

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

Source from the content-addressed store, hash-verified

124 self.assertEqual(bz2f.read(), self.TEXT * 5)
125
126 def testReadMonkeyMultiStream(self):
127 # Test BZ2File.read() on a multi-stream archive where a stream
128 # boundary coincides with the end of the raw read buffer.
129 buffer_size = _streams.BUFFER_SIZE
130 _streams.BUFFER_SIZE = len(self.DATA)
131 try:
132 self.createTempFile(streams=5)
133 with BZ2File(self.filename) as bz2f:
134 self.assertRaises(TypeError, bz2f.read, float())
135 self.assertEqual(bz2f.read(), self.TEXT * 5)
136 finally:
137 _streams.BUFFER_SIZE = buffer_size
138
139 def testReadTrailingJunk(self):
140 self.createTempFile(suffix=self.BAD_DATA)

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected