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

Method testWriteNonDefaultCompressLevel

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

Source from the content-addressed store, hash-verified

264 self.assertEqual(ext_decompress(f.read()), self.TEXT)
265
266 def testWriteNonDefaultCompressLevel(self):
267 expected = bz2.compress(self.TEXT, compresslevel=5)
268 with BZ2File(self.filename, "w", compresslevel=5) as bz2f:
269 bz2f.write(self.TEXT)
270 with open(self.filename, "rb") as f:
271 self.assertEqual(f.read(), expected)
272
273 def testWriteLines(self):
274 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