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

Method testWriteLines

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

Source from the content-addressed store, hash-verified

281 self.assertEqual(f.read(), expected)
282
283 def testWriteLines(self):
284 with BZ2File(self.filename, "w") as bz2f:
285 self.assertRaises(TypeError, bz2f.writelines)
286 bz2f.writelines(self.TEXT_LINES)
287 # Issue #1535500: Calling writelines() on a closed BZ2File
288 # should raise an exception.
289 self.assertRaises(ValueError, bz2f.writelines, ["a"])
290 with open(self.filename, 'rb') as f:
291 self.assertEqual(ext_decompress(f.read()), self.TEXT)
292
293 def testWriteMethodsOnReadOnlyFile(self):
294 with BZ2File(self.filename, "w") as bz2f:

Callers

nothing calls this directly

Calls 7

BZ2FileClass · 0.90
ext_decompressFunction · 0.85
openFunction · 0.50
assertRaisesMethod · 0.45
writelinesMethod · 0.45
assertEqualMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected