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

Method test_writable

Lib/test/test_zstd.py:1862–1877  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1860 self.assertRaises(ValueError, f.readable)
1861
1862 def test_writable(self):
1863 f = ZstdFile(io.BytesIO(COMPRESSED_100_PLUS_32KB))
1864 try:
1865 self.assertFalse(f.writable())
1866 f.read()
1867 self.assertFalse(f.writable())
1868 finally:
1869 f.close()
1870 self.assertRaises(ValueError, f.writable)
1871
1872 f = ZstdFile(io.BytesIO(), "w")
1873 try:
1874 self.assertTrue(f.writable())
1875 finally:
1876 f.close()
1877 self.assertRaises(ValueError, f.writable)
1878
1879 def test_read_0(self):
1880 with ZstdFile(io.BytesIO(COMPRESSED_100_PLUS_32KB)) as f:

Callers

nothing calls this directly

Calls 7

writableMethod · 0.95
readMethod · 0.95
closeMethod · 0.95
ZstdFileClass · 0.90
assertFalseMethod · 0.80
assertTrueMethod · 0.80
assertRaisesMethod · 0.45

Tested by

no test coverage detected