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

Method test_tell

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

Source from the content-addressed store, hash-verified

2304 self.assertEqual(d, DECOMPRESSED_100_PLUS_32KB)
2305
2306 def test_tell(self):
2307 with ZstdFile(io.BytesIO(DAT_130K_C)) as f:
2308 pos = 0
2309 while True:
2310 self.assertEqual(f.tell(), pos)
2311 result = f.read(random.randint(171, 189))
2312 if not result:
2313 break
2314 pos += len(result)
2315 self.assertEqual(f.tell(), len(DAT_130K_D))
2316 with ZstdFile(io.BytesIO(), "w") as f:
2317 for pos in range(0, len(DAT_130K_D), 143):
2318 self.assertEqual(f.tell(), pos)
2319 f.write(DAT_130K_D[pos:pos+143])
2320 self.assertEqual(f.tell(), len(DAT_130K_D))
2321
2322 def test_tell_bad_args(self):
2323 f = ZstdFile(io.BytesIO(COMPRESSED_100_PLUS_32KB))

Callers

nothing calls this directly

Calls 6

ZstdFileClass · 0.90
randintMethod · 0.80
assertEqualMethod · 0.45
tellMethod · 0.45
readMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected