summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_gzip.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2006-11-12 10:41:39 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2006-11-12 10:41:39 (GMT)
commit065f0c8a06e20c0b4f8c500c237cbafa7af7bd18 (patch)
tree65cb2e35ed1a4cee4c34e978aeb5053cc0fe0099 /Lib/test/test_gzip.py
parent040a927cd14e799454b246dd1f56fd7f4fdff03a (diff)
downloadcpython-065f0c8a06e20c0b4f8c500c237cbafa7af7bd18.zip
cpython-065f0c8a06e20c0b4f8c500c237cbafa7af7bd18.tar.gz
cpython-065f0c8a06e20c0b4f8c500c237cbafa7af7bd18.tar.bz2
Patch #1355023: support whence argument for GzipFile.seek.
Diffstat (limited to 'Lib/test/test_gzip.py')
-rw-r--r--Lib/test/test_gzip.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_gzip.py b/Lib/test/test_gzip.py
index 0f8e03e..9989a92 100644
--- a/Lib/test/test_gzip.py
+++ b/Lib/test/test_gzip.py
@@ -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')