summaryrefslogtreecommitdiffstats
path: root/Lib/dos-8x3/test_ima.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-05-08 23:14:57 (GMT)
committerGuido van Rossum <guido@python.org>1997-05-08 23:14:57 (GMT)
commitde554ece418b241ad5058b1e600040c0d1c01891 (patch)
tree787ca28dc2f8582e7ce7f0bb535ef865bf1c7f9f /Lib/dos-8x3/test_ima.py
parent6dd87830d091673741a4aabfb0680ae5ca64c257 (diff)
downloadcpython-de554ece418b241ad5058b1e600040c0d1c01891.zip
cpython-de554ece418b241ad5058b1e600040c0d1c01891.tar.gz
cpython-de554ece418b241ad5058b1e600040c0d1c01891.tar.bz2
The usual.
Diffstat (limited to 'Lib/dos-8x3/test_ima.py')
-rw-r--r--Lib/dos-8x3/test_ima.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/Lib/dos-8x3/test_ima.py b/Lib/dos-8x3/test_ima.py
index fc8dadf..f9108ef 100644
--- a/Lib/dos-8x3/test_ima.py
+++ b/Lib/dos-8x3/test_ima.py
@@ -1,14 +1,19 @@
#! /usr/bin/env python
+
"""Test script for the imageop module. This has the side
effect of partially testing the imgfile module as well.
Roger E. Masse
"""
-from test_support import verbose
-import imageop
+from test_support import verbose, unlink
+
+import imageop, uu
def main(use_rgbimg=1):
+ # Create binary test files
+ uu.decode(get_qualified_path('testrgb.uue'), 'test.rgb')
+
if use_rgbimg:
image, width, height = getrgbimage('test.rgb')
else:
@@ -106,7 +111,10 @@ def main(use_rgbimg=1):
# Convert a 2-bit greyscale image to an 8-bit greyscale image.
if verbose:
print 'grey22grey'
- image = imageop.grey22grey (grey2image, width, height)
+ image = imageop.grey22grey (grey2image, width, height)
+
+ # Cleanup
+ unlink('test.rgb')
def getrgbimage(name):
"""return a tuple consisting of image (in 'imgfile' format but
@@ -160,6 +168,6 @@ def get_qualified_path(name):
name = string.joinfields(parts, os.sep)
return name
-# rgbimg (unlike imgfile) is portable to platforms other than SGI. So we prefer to use it.
+# rgbimg (unlike imgfile) is portable to platforms other than SGI.
+# So we prefer to use it.
main(use_rgbimg=1)
-