Class around PixMap objects that allows more python-like access. By Joe Strout.
[python/dscho.git] / Lib / dos-8x3 / test_gzi.py
blob3ea2ba9bc3997c5a7050a59ce7ecd54ed0b05596
2 import sys, os
3 import gzip, tempfile
5 filename = tempfile.mktemp()
7 data1 = """ int length=DEFAULTALLOC, err = Z_OK;
8 PyObject *RetVal;
9 int flushmode = Z_FINISH;
10 unsigned long start_total_out;
12 """
14 data2 = """/* zlibmodule.c -- gzip-compatible data compression */
15 /* See http://www.cdrom.com/pub/infozip/zlib/ */
16 /* See http://www.winimage.com/zLibDll for Windows */
17 """
19 f = gzip.GzipFile(filename, 'wb') ; f.write(data1) ; f.close()
21 f = gzip.GzipFile(filename, 'rb') ; d = f.read() ; f.close()
22 assert d == data1
24 # Append to the previous file
25 f = gzip.GzipFile(filename, 'ab') ; f.write(data2) ; f.close()
27 f = gzip.GzipFile(filename, 'rb') ; d = f.read() ; f.close()
28 assert d == data1+data2
30 os.unlink( filename )