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

Method testReadable

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

Source from the content-addressed store, hash-verified

431 self.assertRaises(ValueError, bz2f.seekable)
432
433 def testReadable(self):
434 bz2f = BZ2File(BytesIO(self.DATA))
435 try:
436 self.assertTrue(bz2f.readable())
437 bz2f.read()
438 self.assertTrue(bz2f.readable())
439 finally:
440 bz2f.close()
441 self.assertRaises(ValueError, bz2f.readable)
442
443 bz2f = BZ2File(BytesIO(), "w")
444 try:
445 self.assertFalse(bz2f.readable())
446 finally:
447 bz2f.close()
448 self.assertRaises(ValueError, bz2f.readable)
449
450 def testWritable(self):
451 bz2f = BZ2File(BytesIO(self.DATA))

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected