MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_seekable

Method test_seekable

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

Source from the content-addressed store, hash-verified

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