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

Method test_readable

Lib/test/test_lzma.py:783–798  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

781 self.assertRaises(ValueError, f.seekable)
782
783 def test_readable(self):
784 f = LZMAFile(BytesIO(COMPRESSED_XZ))
785 try:
786 self.assertTrue(f.readable())
787 f.read()
788 self.assertTrue(f.readable())
789 finally:
790 f.close()
791 self.assertRaises(ValueError, f.readable)
792
793 f = LZMAFile(BytesIO(), "w")
794 try:
795 self.assertFalse(f.readable())
796 finally:
797 f.close()
798 self.assertRaises(ValueError, f.readable)
799
800 def test_writable(self):
801 f = LZMAFile(BytesIO(COMPRESSED_XZ))

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected