mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Patch #1355023: support whence argument for GzipFile.seek.
This commit is contained in:
parent
040a927cd1
commit
065f0c8a06
3 changed files with 19 additions and 1 deletions
|
|
@ -128,6 +128,17 @@ class TestGzip(unittest.TestCase):
|
|||
f.seek(newpos) # positive seek
|
||||
f.close()
|
||||
|
||||
def test_seek_whence(self):
|
||||
self.test_write()
|
||||
# Try seek(whence=1), read test
|
||||
|
||||
f = gzip.GzipFile(self.filename)
|
||||
f.read(10)
|
||||
f.seek(10, whence=1)
|
||||
y = f.read(10)
|
||||
f.close()
|
||||
self.assertEquals(y, data1[20:30])
|
||||
|
||||
def test_seek_write(self):
|
||||
# Try seek, write test
|
||||
f = gzip.GzipFile(self.filename, 'w')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue