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

Method testReadable

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

Source from the content-addressed store, hash-verified

421 self.assertRaises(ValueError, bz2f.seekable)
422
423 def testReadable(self):
424 bz2f = BZ2File(BytesIO(self.DATA))
425 try:
426 self.assertTrue(bz2f.readable())
427 bz2f.read()
428 self.assertTrue(bz2f.readable())
429 finally:
430 bz2f.close()
431 self.assertRaises(ValueError, bz2f.readable)
432
433 bz2f = BZ2File(BytesIO(), "w")
434 try:
435 self.assertFalse(bz2f.readable())
436 finally:
437 bz2f.close()
438 self.assertRaises(ValueError, bz2f.readable)
439
440 def testWritable(self):
441 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