~ubuntu-branches/ubuntu/dapper/python-gnuplot/dapper

« back to all changes in this revision

Viewing changes to test.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2003-11-16 12:36:26 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20031116123626-1knq7mn30ta2q6ds
Tags: 1.7-3
Fix typo in README.Debian (closes: #219485).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /usr/bin/env python
2
2
 
3
 
# $Id: test.py,v 2.28 2001/01/07 21:35:14 mhagger Exp $
 
3
# $Id: test.py,v 2.34 2003/08/18 22:33:00 mhagger Exp $
4
4
 
5
 
# Copyright (C) 1999-2001 Michael Haggerty <mhagger@alum.mit.edu>
 
5
# Copyright (C) 1999-2003 Michael Haggerty <mhagger@alum.mit.edu>
6
6
#
7
 
# This program is free software; you can redistribute it and/or modify
8
 
# it under the terms of the GNU General Public License as published by
9
 
# the Free Software Foundation; either version 2 of the License, or
10
 
# (at your option) any later version.  This program is distributed in
11
 
# the hope that it will be useful, but WITHOUT ANY WARRANTY; without
12
 
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13
 
# PARTICULAR PURPOSE.  See the GNU General Public License for more
14
 
# details; it is available at <http://www.fsf.org/copyleft/gpl.html>,
15
 
# or by writing to the Free Software Foundation, Inc., 59 Temple Place
16
 
# - Suite 330, Boston, MA 02111-1307, USA.
 
7
# This file is licensed under the GNU Lesser General Public License
 
8
# (LGPL).  See LICENSE.txt for details.
17
9
 
18
10
"""test.py -- Exercise the Gnuplot.py module.
19
11
 
22
14
 
23
15
"""
24
16
 
25
 
__cvs_version__ = '$Revision: 2.28 $'
 
17
__cvs_version__ = '$Revision: 2.34 $'
26
18
 
27
 
import math, time, tempfile
 
19
import os, time, math, tempfile
28
20
import Numeric
29
21
from Numeric import NewAxis
30
22
 
49
41
def main():
50
42
    """Exercise the Gnuplot module."""
51
43
 
 
44
    print (
 
45
        'This program exercises many of the features of Gnuplot.py.  The\n'
 
46
        'commands that are actually sent to gnuplot are printed for your\n'
 
47
        'enjoyment.'
 
48
        )
 
49
 
52
50
    wait('Popping up a blank gnuplot window on your screen.')
53
 
    g = Gnuplot.Gnuplot()
 
51
    g = Gnuplot.Gnuplot(debug=1)
54
52
    g.clear()
55
53
 
56
54
    # Make a temporary file:
57
55
    filename1 = tempfile.mktemp()
58
56
    f = open(filename1, 'w')
59
 
    for x in Numeric.arange(100)/5. - 10.:
60
 
        f.write('%s %s %s\n' % (x, math.cos(x), math.sin(x)))
61
 
    f.close()
62
 
    # ensure that file will be deleted upon exit:
63
 
    file1 = Gnuplot.PlotItems.TempFile(filename1)
64
 
 
65
 
    print '############### test Func ########################################'
66
 
    wait('Plot a gnuplot-generated function')
67
 
    g.plot(Gnuplot.Func('sin(x)'))
68
 
 
69
 
    wait('Set title and axis labels and try replot()')
70
 
    g.title('Title')
71
 
    g.xlabel('x')
72
 
    g.ylabel('y')
73
 
    g.replot()
74
 
 
75
 
    wait('Style linespoints')
76
 
    g.plot(Gnuplot.Func('sin(x)', with='linespoints'))
77
 
    wait('title=None')
78
 
    g.plot(Gnuplot.Func('sin(x)', title=None))
79
 
    wait('title="Sine of x"')
80
 
    g.plot(Gnuplot.Func('sin(x)', title='Sine of x'))
81
 
    wait('axes=x2y2')
82
 
    g.plot(Gnuplot.Func('sin(x)', axes='x2y2', title='Sine of x'))
83
 
 
84
 
    print 'Change Func attributes after construction:'
85
 
    f = Gnuplot.Func('sin(x)')
86
 
    wait('Original')
87
 
    g.plot(f)
88
 
    wait('Style linespoints')
89
 
    f.set_option(with='linespoints')
90
 
    g.plot(f)
91
 
    wait('title=None')
92
 
    f.set_option(title=None)
93
 
    g.plot(f)
94
 
    wait('title="Sine of x"')
95
 
    f.set_option(title='Sine of x')
96
 
    g.plot(f)
97
 
    wait('axes=x2y2')
98
 
    f.set_option(axes='x2y2')
99
 
    g.plot(f)
100
 
 
101
 
    print '############### test File ########################################'
102
 
    wait('Generate a File from a filename')
103
 
    g.plot(Gnuplot.File(filename1))
104
 
    wait('Generate a File given a TempFile object')
105
 
    g.plot(Gnuplot.File(file1))
106
 
 
107
 
    wait('Style lines')
108
 
    g.plot(Gnuplot.File(filename1, with='lines'))
109
 
    wait('using=1, using=(1,)')
110
 
    g.plot(Gnuplot.File(filename1, using=1, with='lines'),
111
 
           Gnuplot.File(filename1, using=(1,), with='points'))
112
 
    wait('using=(1,2), using="1:3"')
113
 
    g.plot(Gnuplot.File(filename1, using=(1,2)),
114
 
           Gnuplot.File(filename1, using='1:3'))
115
 
    wait('title=None')
116
 
    g.plot(Gnuplot.File(filename1, title=None))
117
 
    wait('title="title"')
118
 
    g.plot(Gnuplot.File(filename1, title='title'))
119
 
 
120
 
    print 'Change File attributes after construction:'
121
 
    f = Gnuplot.File(filename1)
122
 
    wait('Original')
123
 
    g.plot(f)
124
 
    wait('Style linespoints')
125
 
    f.set_option(with='linespoints')
126
 
    g.plot(f)
127
 
    wait('using=(1,3)')
128
 
    f.set_option(using=(1,3))
129
 
    g.plot(f)
130
 
    wait('title=None')
131
 
    f.set_option(title=None)
132
 
    g.plot(f)
133
 
 
134
 
    print '############### test Data ########################################'
135
 
    x = Numeric.arange(100)/5. - 10.
136
 
    y1 = Numeric.cos(x)
137
 
    y2 = Numeric.sin(x)
138
 
    d = Numeric.transpose((x,y1,y2))
139
 
 
140
 
    wait('Plot Data, specified column-by-column')
141
 
    g.plot(Gnuplot.Data(x,y2, inline=0))
142
 
    wait('Same thing, inline data')
143
 
    g.plot(Gnuplot.Data(x,y2, inline=1))
144
 
 
145
 
    wait('Plot Data, specified by an array')
146
 
    g.plot(Gnuplot.Data(d, inline=0))
147
 
    wait('Same thing, inline data')
148
 
    g.plot(Gnuplot.Data(d, inline=1))
149
 
    wait('with="lp 4 4"')
150
 
    g.plot(Gnuplot.Data(d, with='lp 4 4'))
151
 
    wait('cols=0')
152
 
    g.plot(Gnuplot.Data(d, cols=0))
153
 
    wait('cols=(0,1), cols=(0,2)')
154
 
    g.plot(Gnuplot.Data(d, cols=(0,1), inline=0),
155
 
           Gnuplot.Data(d, cols=(0,2), inline=0))
156
 
    wait('Same thing, inline data')
157
 
    g.plot(Gnuplot.Data(d, cols=(0,1), inline=1),
158
 
           Gnuplot.Data(d, cols=(0,2), inline=1))
159
 
    wait('Change title and replot()')
160
 
    g.title('New title')
161
 
    g.replot()
162
 
    wait('title=None')
163
 
    g.plot(Gnuplot.Data(d, title=None))
164
 
    wait('title="Cosine of x"')
165
 
    g.plot(Gnuplot.Data(d, title='Cosine of x'))
166
 
 
167
 
    print '############### test compute_Data ################################'
168
 
    x = Numeric.arange(100)/5. - 10.
169
 
 
170
 
    wait('Plot Data, computed by Gnuplot.py')
171
 
    g.plot(Gnuplot.funcutils.compute_Data(x, lambda x: math.cos(x), inline=0))
172
 
    wait('Same thing, inline data')
173
 
    g.plot(Gnuplot.funcutils.compute_Data(x, math.cos, inline=1))
174
 
    wait('with="lp 4 4"')
175
 
    g.plot(Gnuplot.funcutils.compute_Data(x, math.cos, with='lp 4 4'))
176
 
 
177
 
    print '############### test hardcopy ####################################'
178
 
    print '******** Generating postscript file "gp_test.ps" ********'
179
 
    wait()
180
 
    g.plot(Gnuplot.Func('cos(0.5*x*x)', with='linespoints 2 2',
181
 
                   title='cos(0.5*x^2)'))
182
 
    g.hardcopy('gp_test.ps')
183
 
 
184
 
    wait('Testing hardcopy options: mode="landscape"')
185
 
    g.hardcopy('gp_test.ps', mode='landscape')
186
 
    wait('Testing hardcopy options: mode="portrait"')
187
 
    g.hardcopy('gp_test.ps', mode='portrait')
188
 
    wait('Testing hardcopy options: mode="eps"')
189
 
    g.hardcopy('gp_test.ps', mode='eps')
190
 
    wait('Testing hardcopy options: eps=1')
191
 
    g.hardcopy('gp_test.ps', eps=1)
192
 
    wait('Testing hardcopy options: enhanced=1')
193
 
    g.hardcopy('gp_test.ps', eps=0, enhanced=1)
194
 
    wait('Testing hardcopy options: enhanced=0')
195
 
    g.hardcopy('gp_test.ps', enhanced=0)
196
 
    wait('Testing hardcopy options: color=1')
197
 
    g.hardcopy('gp_test.ps', color=1)
198
 
    wait('Testing hardcopy options: solid=1')
199
 
    g.hardcopy('gp_test.ps', color=0, solid=1)
200
 
    wait('Testing hardcopy options: duplexing="duplex"')
201
 
    g.hardcopy('gp_test.ps', solid=0, duplexing='duplex')
202
 
    wait('Testing hardcopy options: duplexing="defaultplex"')
203
 
    g.hardcopy('gp_test.ps', duplexing='defaultplex')
204
 
    wait('Testing hardcopy options: fontname="Times-Italic"')
205
 
    g.hardcopy('gp_test.ps', fontname='Times-Italic')
206
 
    wait('Testing hardcopy options: fontsize=20')
207
 
    g.hardcopy('gp_test.ps', fontsize=20)
208
 
    wait('Testing hardcopy options: mode="default"')
209
 
    g.hardcopy('gp_test.ps', mode='default')
210
 
 
211
 
    print '############### test shortcuts ###################################'
212
 
    wait('plot Func and Data using shortcuts')
213
 
    g.plot('sin(x)', d)
214
 
 
215
 
    print '############### test splot #######################################'
216
 
    wait('a 3-d curve')
217
 
    g.splot(Gnuplot.Data(d, with='linesp', inline=0))
218
 
    wait('Same thing, inline data')
219
 
    g.splot(Gnuplot.Data(d, with='linesp', inline=1))
220
 
 
221
 
    print '############### test GridData and compute_GridData ###############'
222
 
    # set up x and y values at which the function will be tabulated:
223
 
    x = Numeric.arange(35)/2.0
224
 
    y = Numeric.arange(30)/10.0 - 1.5
225
 
    # Make a 2-d array containing a function of x and y.  First create
226
 
    # xm and ym which contain the x and y values in a matrix form that
227
 
    # can be `broadcast' into a matrix of the appropriate shape:
228
 
    xm = x[:,NewAxis]
229
 
    ym = y[NewAxis,:]
230
 
    m = (Numeric.sin(xm) + 0.1*xm) - ym**2
231
 
    wait('a function of two variables from a GridData file')
232
 
    g('set parametric')
233
 
    g('set data style lines')
234
 
    g('set hidden')
235
 
    g('set contour base')
236
 
    g.xlabel('x')
237
 
    g.ylabel('y')
238
 
    g.splot(Gnuplot.GridData(m,x,y, binary=0, inline=0))
239
 
    wait('Same thing, inline data')
240
 
    g.splot(Gnuplot.GridData(m,x,y, binary=0, inline=1))
241
 
 
242
 
    wait('The same thing using binary mode')
243
 
    g.splot(Gnuplot.GridData(m,x,y, binary=1))
244
 
 
245
 
    wait('The same thing using compute_GridData to tabulate function')
246
 
    g.splot(Gnuplot.funcutils.compute_GridData(
247
 
        x,y, lambda x,y: math.sin(x) + 0.1*x - y**2,
248
 
        ))
249
 
 
250
 
    wait('Use compute_GridData in ufunc and binary mode')
251
 
    g.splot(Gnuplot.funcutils.compute_GridData(
252
 
        x,y, lambda x,y: Numeric.sin(x) + 0.1*x - y**2,
253
 
        ufunc=1, binary=1,
254
 
        ))
255
 
 
256
 
    wait('And now rotate it a bit')
257
 
    for view in range(35,70,5):
258
 
        g('set view 60, %d' % view)
259
 
        g.replot()
260
 
        time.sleep(1.0)
261
 
 
262
 
    wait(prompt='Press return to end the test.\n')
 
57
    try:
 
58
        for x in Numeric.arange(100)/5. - 10.:
 
59
            f.write('%s %s %s\n' % (x, math.cos(x), math.sin(x)))
 
60
        f.close()
 
61
 
 
62
        print '############### test Func ###################################'
 
63
        wait('Plot a gnuplot-generated function')
 
64
        g.plot(Gnuplot.Func('sin(x)'))
 
65
 
 
66
        wait('Set title and axis labels and try replot()')
 
67
        g.title('Title')
 
68
        g.xlabel('x')
 
69
        g.ylabel('y')
 
70
        g.replot()
 
71
 
 
72
        wait('Style linespoints')
 
73
        g.plot(Gnuplot.Func('sin(x)', with='linespoints'))
 
74
        wait('title=None')
 
75
        g.plot(Gnuplot.Func('sin(x)', title=None))
 
76
        wait('title="Sine of x"')
 
77
        g.plot(Gnuplot.Func('sin(x)', title='Sine of x'))
 
78
        wait('axes=x2y2')
 
79
        g.plot(Gnuplot.Func('sin(x)', axes='x2y2', title='Sine of x'))
 
80
 
 
81
        print 'Change Func attributes after construction:'
 
82
        f = Gnuplot.Func('sin(x)')
 
83
        wait('Original')
 
84
        g.plot(f)
 
85
        wait('Style linespoints')
 
86
        f.set_option(with='linespoints')
 
87
        g.plot(f)
 
88
        wait('title=None')
 
89
        f.set_option(title=None)
 
90
        g.plot(f)
 
91
        wait('title="Sine of x"')
 
92
        f.set_option(title='Sine of x')
 
93
        g.plot(f)
 
94
        wait('axes=x2y2')
 
95
        f.set_option(axes='x2y2')
 
96
        g.plot(f)
 
97
 
 
98
        print '############### test File ###################################'
 
99
        wait('Generate a File from a filename')
 
100
        g.plot(Gnuplot.File(filename1))
 
101
 
 
102
        wait('Style lines')
 
103
        g.plot(Gnuplot.File(filename1, with='lines'))
 
104
 
 
105
        wait('using=1, using=(1,)')
 
106
        g.plot(Gnuplot.File(filename1, using=1, with='lines'),
 
107
               Gnuplot.File(filename1, using=(1,), with='points'))
 
108
        wait('using=(1,2), using="1:3"')
 
109
        g.plot(Gnuplot.File(filename1, using=(1,2)),
 
110
               Gnuplot.File(filename1, using='1:3'))
 
111
 
 
112
        wait('every=5, every=(5,)')
 
113
        g.plot(Gnuplot.File(filename1, every=5, with='lines'),
 
114
               Gnuplot.File(filename1, every=(5,), with='points'))
 
115
        wait('every=(10,None,0), every="10::5"')
 
116
        g.plot(Gnuplot.File(filename1, with='lines'),
 
117
               Gnuplot.File(filename1, every=(10,None,0)),
 
118
               Gnuplot.File(filename1, every='10::5'))
 
119
 
 
120
        wait('title=None')
 
121
        g.plot(Gnuplot.File(filename1, title=None))
 
122
        wait('title="title"')
 
123
        g.plot(Gnuplot.File(filename1, title='title'))
 
124
 
 
125
        print 'Change File attributes after construction:'
 
126
        f = Gnuplot.File(filename1)
 
127
        wait('Original')
 
128
        g.plot(f)
 
129
        wait('Style linespoints')
 
130
        f.set_option(with='linespoints')
 
131
        g.plot(f)
 
132
        wait('using=(1,3)')
 
133
        f.set_option(using=(1,3))
 
134
        g.plot(f)
 
135
        wait('title=None')
 
136
        f.set_option(title=None)
 
137
        g.plot(f)
 
138
 
 
139
        print '############### test Data ###################################'
 
140
        x = Numeric.arange(100)/5. - 10.
 
141
        y1 = Numeric.cos(x)
 
142
        y2 = Numeric.sin(x)
 
143
        d = Numeric.transpose((x,y1,y2))
 
144
 
 
145
        wait('Plot Data against its index')
 
146
        g.plot(Gnuplot.Data(y2, inline=0))
 
147
 
 
148
        wait('Plot Data, specified column-by-column')
 
149
        g.plot(Gnuplot.Data(x,y2, inline=0))
 
150
        wait('Same thing, inline data')
 
151
        g.plot(Gnuplot.Data(x,y2, inline=1))
 
152
 
 
153
        wait('Plot Data, specified by an array')
 
154
        g.plot(Gnuplot.Data(d, inline=0))
 
155
        wait('Same thing, inline data')
 
156
        g.plot(Gnuplot.Data(d, inline=1))
 
157
        wait('with="lp 4 4"')
 
158
        g.plot(Gnuplot.Data(d, with='lp 4 4'))
 
159
        wait('cols=0')
 
160
        g.plot(Gnuplot.Data(d, cols=0))
 
161
        wait('cols=(0,1), cols=(0,2)')
 
162
        g.plot(Gnuplot.Data(d, cols=(0,1), inline=0),
 
163
               Gnuplot.Data(d, cols=(0,2), inline=0))
 
164
        wait('Same thing, inline data')
 
165
        g.plot(Gnuplot.Data(d, cols=(0,1), inline=1),
 
166
               Gnuplot.Data(d, cols=(0,2), inline=1))
 
167
        wait('Change title and replot()')
 
168
        g.title('New title')
 
169
        g.replot()
 
170
        wait('title=None')
 
171
        g.plot(Gnuplot.Data(d, title=None))
 
172
        wait('title="Cosine of x"')
 
173
        g.plot(Gnuplot.Data(d, title='Cosine of x'))
 
174
 
 
175
        print '############### test compute_Data ###########################'
 
176
        x = Numeric.arange(100)/5. - 10.
 
177
 
 
178
        wait('Plot Data, computed by Gnuplot.py')
 
179
        g.plot(Gnuplot.funcutils.compute_Data(x, lambda x: math.cos(x), inline=0))
 
180
        wait('Same thing, inline data')
 
181
        g.plot(Gnuplot.funcutils.compute_Data(x, math.cos, inline=1))
 
182
        wait('with="lp 4 4"')
 
183
        g.plot(Gnuplot.funcutils.compute_Data(x, math.cos, with='lp 4 4'))
 
184
 
 
185
        print '############### test hardcopy ###############################'
 
186
        print '******** Generating postscript file "gp_test.ps" ********'
 
187
        wait()
 
188
        g.plot(Gnuplot.Func('cos(0.5*x*x)', with='linespoints 2 2',
 
189
                       title='cos(0.5*x^2)'))
 
190
        g.hardcopy('gp_test.ps')
 
191
 
 
192
        wait('Testing hardcopy options: mode="eps"')
 
193
        g.hardcopy('gp_test.ps', mode='eps')
 
194
        wait('Testing hardcopy options: mode="landscape"')
 
195
        g.hardcopy('gp_test.ps', mode='landscape')
 
196
        wait('Testing hardcopy options: mode="portrait"')
 
197
        g.hardcopy('gp_test.ps', mode='portrait')
 
198
        wait('Testing hardcopy options: eps=1')
 
199
        g.hardcopy('gp_test.ps', eps=1)
 
200
        wait('Testing hardcopy options: mode="default"')
 
201
        g.hardcopy('gp_test.ps', mode='default')
 
202
        wait('Testing hardcopy options: enhanced=1')
 
203
        g.hardcopy('gp_test.ps', enhanced=1)
 
204
        wait('Testing hardcopy options: enhanced=0')
 
205
        g.hardcopy('gp_test.ps', enhanced=0)
 
206
        wait('Testing hardcopy options: color=1')
 
207
        g.hardcopy('gp_test.ps', color=1)
 
208
        # For some reason, 
 
209
        #    g.hardcopy('gp_test.ps', color=0, solid=1)
 
210
        # doesn't work here (it doesn't activate the solid option), even
 
211
        # though the command sent to gnuplot looks correct.  I'll
 
212
        # tentatively conclude that it is a gnuplot bug. ###
 
213
        wait('Testing hardcopy options: color=0')
 
214
        g.hardcopy('gp_test.ps', color=0)
 
215
        wait('Testing hardcopy options: solid=1')
 
216
        g.hardcopy('gp_test.ps', solid=1)
 
217
        wait('Testing hardcopy options: duplexing="duplex"')
 
218
        g.hardcopy('gp_test.ps', solid=0, duplexing='duplex')
 
219
        wait('Testing hardcopy options: duplexing="defaultplex"')
 
220
        g.hardcopy('gp_test.ps', duplexing='defaultplex')
 
221
        wait('Testing hardcopy options: fontname="Times-Italic"')
 
222
        g.hardcopy('gp_test.ps', fontname='Times-Italic')
 
223
        wait('Testing hardcopy options: fontsize=20')
 
224
        g.hardcopy('gp_test.ps', fontsize=20)
 
225
 
 
226
        print '############### test shortcuts ##############################'
 
227
        wait('plot Func and Data using shortcuts')
 
228
        g.plot('sin(x)', d)
 
229
 
 
230
        print '############### test splot ##################################'
 
231
        wait('a 3-d curve')
 
232
        g.splot(Gnuplot.Data(d, with='linesp', inline=0))
 
233
        wait('Same thing, inline data')
 
234
        g.splot(Gnuplot.Data(d, with='linesp', inline=1))
 
235
 
 
236
        print '############### test GridData and compute_GridData ##########'
 
237
        # set up x and y values at which the function will be tabulated:
 
238
        x = Numeric.arange(35)/2.0
 
239
        y = Numeric.arange(30)/10.0 - 1.5
 
240
        # Make a 2-d array containing a function of x and y.  First create
 
241
        # xm and ym which contain the x and y values in a matrix form that
 
242
        # can be `broadcast' into a matrix of the appropriate shape:
 
243
        xm = x[:,NewAxis]
 
244
        ym = y[NewAxis,:]
 
245
        m = (Numeric.sin(xm) + 0.1*xm) - ym**2
 
246
        wait('a function of two variables from a GridData file')
 
247
        g('set parametric')
 
248
        g('set data style lines')
 
249
        g('set hidden')
 
250
        g('set contour base')
 
251
        g.xlabel('x')
 
252
        g.ylabel('y')
 
253
        g.splot(Gnuplot.GridData(m,x,y, binary=0, inline=0))
 
254
        wait('Same thing, inline data')
 
255
        g.splot(Gnuplot.GridData(m,x,y, binary=0, inline=1))
 
256
 
 
257
        wait('The same thing using binary mode')
 
258
        g.splot(Gnuplot.GridData(m,x,y, binary=1))
 
259
 
 
260
        wait('The same thing using compute_GridData to tabulate function')
 
261
        g.splot(Gnuplot.funcutils.compute_GridData(
 
262
            x,y, lambda x,y: math.sin(x) + 0.1*x - y**2,
 
263
            ))
 
264
 
 
265
        wait('Use compute_GridData in ufunc and binary mode')
 
266
        g.splot(Gnuplot.funcutils.compute_GridData(
 
267
            x,y, lambda x,y: Numeric.sin(x) + 0.1*x - y**2,
 
268
            ufunc=1, binary=1,
 
269
            ))
 
270
 
 
271
        wait('And now rotate it a bit')
 
272
        for view in range(35,70,5):
 
273
            g('set view 60, %d' % view)
 
274
            g.replot()
 
275
            time.sleep(1.0)
 
276
 
 
277
        wait(prompt='Press return to end the test.\n')
 
278
    finally:
 
279
        os.unlink(filename1)
263
280
 
264
281
 
265
282
# when executed, just run main():