summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_gzip.py
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2004-07-27 21:02:02 (GMT)
committerTim Peters <tim.peters@gmail.com>2004-07-27 21:02:02 (GMT)
commit5cfb05eef04707679077a45ebbe2b096840261a0 (patch)
tree57bcd4e40f31a8b3a36bffee8931e6244006bec1 /Lib/test/test_gzip.py
parentfe393f47c662c307d2d3e90f785edf5821d54a8d (diff)
downloadcpython-5cfb05eef04707679077a45ebbe2b096840261a0.zip
cpython-5cfb05eef04707679077a45ebbe2b096840261a0.tar.gz
cpython-5cfb05eef04707679077a45ebbe2b096840261a0.tar.bz2
Added a new fileno() method. ZODB's repozo.py wants this so it can
apply os.fsync() to the GzipFile backup files it creates.
Diffstat (limited to 'Lib/test/test_gzip.py')
-rw-r--r--Lib/test/test_gzip.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/test/test_gzip.py b/Lib/test/test_gzip.py
index bb4ed49..81a4865 100644
--- a/Lib/test/test_gzip.py
+++ b/Lib/test/test_gzip.py
@@ -16,8 +16,16 @@ data2 = """/* zlibmodule.c -- gzip-compatible data compression */
/* See http://www.winimage.com/zLibDll for Windows */
"""
-f = gzip.GzipFile(filename, 'wb') ; f.write(data1 * 50) ; f.close()
+f = gzip.GzipFile(filename, 'wb') ; f.write(data1 * 50)
+# Try flush and fileno.
+f.flush()
+f.fileno()
+if hasattr(os, 'fsync'):
+ os.fsync(f.fileno())
+f.close()
+
+# Try reading.
f = gzip.GzipFile(filename, 'r') ; d = f.read() ; f.close()
verify(d == data1*50)