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

Method test_read_0

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

Source from the content-addressed store, hash-verified

1877 self.assertRaises(ValueError, f.writable)
1878
1879 def test_read_0(self):
1880 with ZstdFile(io.BytesIO(COMPRESSED_100_PLUS_32KB)) as f:
1881 self.assertEqual(f.read(0), b"")
1882 self.assertEqual(f.read(), DECOMPRESSED_100_PLUS_32KB)
1883 with ZstdFile(io.BytesIO(COMPRESSED_100_PLUS_32KB),
1884 options={DecompressionParameter.window_log_max:20}) as f:
1885 self.assertEqual(f.read(0), b"")
1886
1887 # empty file
1888 with ZstdFile(io.BytesIO(b'')) as f:
1889 self.assertEqual(f.read(0), b"")
1890 with self.assertRaises(EOFError):
1891 f.read(10)
1892
1893 with ZstdFile(io.BytesIO(b'')) as f:
1894 with self.assertRaises(EOFError):
1895 f.read(10)
1896
1897 def test_read_10(self):
1898 with ZstdFile(io.BytesIO(COMPRESSED_100_PLUS_32KB)) as f:

Callers

nothing calls this directly

Calls 4

ZstdFileClass · 0.90
assertEqualMethod · 0.45
readMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected