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

Method testWriteLines

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

Source from the content-addressed store, hash-verified

271 self.assertEqual(f.read(), expected)
272
273 def testWriteLines(self):
274 with BZ2File(self.filename, "w") as bz2f:
275 self.assertRaises(TypeError, bz2f.writelines)
276 bz2f.writelines(self.TEXT_LINES)
277 # Issue #1535500: Calling writelines() on a closed BZ2File
278 # should raise an exception.
279 self.assertRaises(ValueError, bz2f.writelines, ["a"])
280 with open(self.filename, 'rb') as f:
281 self.assertEqual(ext_decompress(f.read()), self.TEXT)
282
283 def testWriteMethodsOnReadOnlyFile(self):
284 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