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

Method test_seek_not_seekable

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

Source from the content-addressed store, hash-verified

2290 self.assertRaises(TypeError, f.seek, b"derp")
2291
2292 def test_seek_not_seekable(self):
2293 class C(io.BytesIO):
2294 def seekable(self):
2295 return False
2296 obj = C(COMPRESSED_100_PLUS_32KB)
2297 with ZstdFile(obj, 'r') as f:
2298 d = f.read(1)
2299 self.assertFalse(f.seekable())
2300 with self.assertRaisesRegex(io.UnsupportedOperation,
2301 'File or stream is not seekable'):
2302 f.seek(0)
2303 d += f.read()
2304 self.assertEqual(d, DECOMPRESSED_100_PLUS_32KB)
2305
2306 def test_tell(self):
2307 with ZstdFile(io.BytesIO(DAT_130K_C)) as f:

Callers

nothing calls this directly

Calls 8

ZstdFileClass · 0.90
assertFalseMethod · 0.80
assertRaisesRegexMethod · 0.80
CClass · 0.70
readMethod · 0.45
seekableMethod · 0.45
seekMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected