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

Method test_seekable

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

Source from the content-addressed store, hash-verified

1817 f.name
1818
1819 def test_seekable(self):
1820 f = ZstdFile(io.BytesIO(COMPRESSED_100_PLUS_32KB))
1821 try:
1822 self.assertTrue(f.seekable())
1823 f.read()
1824 self.assertTrue(f.seekable())
1825 finally:
1826 f.close()
1827 self.assertRaises(ValueError, f.seekable)
1828
1829 f = ZstdFile(io.BytesIO(), "w")
1830 try:
1831 self.assertFalse(f.seekable())
1832 finally:
1833 f.close()
1834 self.assertRaises(ValueError, f.seekable)
1835
1836 src = io.BytesIO(COMPRESSED_100_PLUS_32KB)
1837 src.seekable = lambda: False
1838 f = ZstdFile(src)
1839 try:
1840 self.assertFalse(f.seekable())
1841 finally:
1842 f.close()
1843 self.assertRaises(ValueError, f.seekable)
1844
1845 def test_readable(self):
1846 f = ZstdFile(io.BytesIO(COMPRESSED_100_PLUS_32KB))

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected