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

Method testAppend

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

Source from the content-addressed store, hash-verified

289 self.assertRaises(OSError, bz2f.writelines, [b"a"])
290
291 def testAppend(self):
292 with BZ2File(self.filename, "w") as bz2f:
293 self.assertRaises(TypeError, bz2f.write)
294 bz2f.write(self.TEXT)
295 with BZ2File(self.filename, "a") as bz2f:
296 self.assertRaises(TypeError, bz2f.write)
297 bz2f.write(self.TEXT)
298 with open(self.filename, 'rb') as f:
299 self.assertEqual(ext_decompress(f.read()), self.TEXT * 2)
300
301 def testSeekForward(self):
302 self.createTempFile()

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected