Skip to content

Commit f2f2374

Browse files
5ec1cffpicnixz
andauthored
Apply suggestions from code review
Co-authored-by: Bénédikt Tran <[email protected]>
1 parent 25f0a7e commit f2f2374

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Lib/test/test_zipfile/test_core.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3464,15 +3464,15 @@ def read(self, size=-1):
34643464
# 20000 bytes
34653465
txt = b'0123456789' * 2000
34663466

3467-
# The seek length must be greater than ZipExtFile.MIN_READ_SIZE (4096)
3468-
# as `ZipExtFile._read2()` reads in blocks of this size and we need to
3469-
# seek out of the buffered data
3467+
# The seek length must be greater than ZipExtFile.MIN_READ_SIZE
3468+
# as `ZipExtFile._read2()` reads in blocks of this size and we
3469+
# need to seek out of the buffered data
34703470
min_size = zipfile.ZipExtFile.MIN_READ_SIZE
3471-
self.assertGreaterEqual(10002, min_size)
3472-
self.assertGreaterEqual(5003, min_size)
3471+
self.assertGreaterEqual(10002, min_size) # for forward seek test
3472+
self.assertGreaterEqual(5003, min_size) # for backward seek test
34733473
# The read length must be less than MIN_READ_SIZE, since we assume that
34743474
# only 1 block is read in the test.
3475-
self.assertGreaterEqual(min_size, 100)
3475+
self.assertGreaterEqual(min_size, 100) # for read() calls
34763476

34773477
with zipfile.ZipFile(sio, "w", compression=zipfile.ZIP_STORED) as zipf:
34783478
zipf.writestr("foo.txt", txt)
@@ -3498,7 +3498,7 @@ def read(self, size=-1):
34983498
# backward seek
34993499
old_count = sio.bytes_read
35003500
fp.seek(-5003, os.SEEK_CUR)
3501-
self.assertEqual(fp.tell(), 5099)
3501+
self.assertEqual(fp.tell(), 5099) # 5099 = 10102 - 5003
35023502
self.assertEqual(fp._left, fp._compress_left)
35033503
arr = fp.read(100)
35043504
self.assertEqual(fp.tell(), 5199)

0 commit comments

Comments
 (0)