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

Method testWriteChunks10

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

Source from the content-addressed store, hash-verified

262 self.assertEqual(ext_decompress(f.read()), self.TEXT)
263
264 def testWriteChunks10(self):
265 with BZ2File(self.filename, "w") as bz2f:
266 n = 0
267 while True:
268 str = self.TEXT[n*10:(n+1)*10]
269 if not str:
270 break
271 bz2f.write(str)
272 n += 1
273 with open(self.filename, 'rb') as f:
274 self.assertEqual(ext_decompress(f.read()), self.TEXT)
275
276 def testWriteNonDefaultCompressLevel(self):
277 expected = bz2.compress(self.TEXT, compresslevel=5)

Callers

nothing calls this directly

Calls 6

BZ2FileClass · 0.90
ext_decompressFunction · 0.85
openFunction · 0.50
writeMethod · 0.45
assertEqualMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected