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

Method test_writable

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

Source from the content-addressed store, hash-verified

798 self.assertRaises(ValueError, f.readable)
799
800 def test_writable(self):
801 f = LZMAFile(BytesIO(COMPRESSED_XZ))
802 try:
803 self.assertFalse(f.writable())
804 f.read()
805 self.assertFalse(f.writable())
806 finally:
807 f.close()
808 self.assertRaises(ValueError, f.writable)
809
810 f = LZMAFile(BytesIO(), "w")
811 try:
812 self.assertTrue(f.writable())
813 finally:
814 f.close()
815 self.assertRaises(ValueError, f.writable)
816
817 def test_read(self):
818 with LZMAFile(BytesIO(COMPRESSED_XZ)) as f:

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected