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

Method testWriteNonDefaultCompressLevel

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

Source from the content-addressed store, hash-verified

274 self.assertEqual(ext_decompress(f.read()), self.TEXT)
275
276 def testWriteNonDefaultCompressLevel(self):
277 expected = bz2.compress(self.TEXT, compresslevel=5)
278 with BZ2File(self.filename, "w", compresslevel=5) as bz2f:
279 bz2f.write(self.TEXT)
280 with open(self.filename, "rb") as f:
281 self.assertEqual(f.read(), expected)
282
283 def testWriteLines(self):
284 with BZ2File(self.filename, "w") as bz2f:

Callers

nothing calls this directly

Calls 6

BZ2FileClass · 0.90
openFunction · 0.50
compressMethod · 0.45
writeMethod · 0.45
assertEqualMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected