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

Method testWritable

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

Source from the content-addressed store, hash-verified

438 self.assertRaises(ValueError, bz2f.readable)
439
440 def testWritable(self):
441 bz2f = BZ2File(BytesIO(self.DATA))
442 try:
443 self.assertFalse(bz2f.writable())
444 bz2f.read()
445 self.assertFalse(bz2f.writable())
446 finally:
447 bz2f.close()
448 self.assertRaises(ValueError, bz2f.writable)
449
450 bz2f = BZ2File(BytesIO(), "w")
451 try:
452 self.assertTrue(bz2f.writable())
453 finally:
454 bz2f.close()
455 self.assertRaises(ValueError, bz2f.writable)
456
457 def testOpenDel(self):
458 self.createTempFile()

Callers

nothing calls this directly

Calls 8

writableMethod · 0.95
readMethod · 0.95
closeMethod · 0.95
BZ2FileClass · 0.90
BytesIOClass · 0.90
assertFalseMethod · 0.80
assertTrueMethod · 0.80
assertRaisesMethod · 0.45

Tested by

no test coverage detected