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

Method test_writable

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

Source from the content-addressed store, hash-verified

788 self.assertRaises(ValueError, f.readable)
789
790 def test_writable(self):
791 f = LZMAFile(BytesIO(COMPRESSED_XZ))
792 try:
793 self.assertFalse(f.writable())
794 f.read()
795 self.assertFalse(f.writable())
796 finally:
797 f.close()
798 self.assertRaises(ValueError, f.writable)
799
800 f = LZMAFile(BytesIO(), "w")
801 try:
802 self.assertTrue(f.writable())
803 finally:
804 f.close()
805 self.assertRaises(ValueError, f.writable)
806
807 def test_read(self):
808 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