MCPcopy Create free account
hub / github.com/RustPython/RustPython / test_read_0

Method test_read_0

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

Source from the content-addressed store, hash-verified

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