summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_imgfile.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-04-16 00:30:45 (GMT)
committerGuido van Rossum <guido@python.org>1997-04-16 00:30:45 (GMT)
commit7aa9fc5642a08cdb94b698a0610c9dca01fb4d56 (patch)
tree3dd65df0dcadabbdf1a694f2a0f49b7894e7bf70 /Lib/test/test_imgfile.py
parent684480f4197cd4970321f90bd703458dbd3873cf (diff)
downloadcpython-7aa9fc5642a08cdb94b698a0610c9dca01fb4d56.zip
cpython-7aa9fc5642a08cdb94b698a0610c9dca01fb4d56.tar.gz
cpython-7aa9fc5642a08cdb94b698a0610c9dca01fb4d56.tar.bz2
Use uuencoded test images.
Diffstat (limited to 'Lib/test/test_imgfile.py')
-rwxr-xr-xLib/test/test_imgfile.py23
1 files changed, 19 insertions, 4 deletions
diff --git a/Lib/test/test_imgfile.py b/Lib/test/test_imgfile.py
index 8a3b91e..576a51c 100755
--- a/Lib/test/test_imgfile.py
+++ b/Lib/test/test_imgfile.py
@@ -1,13 +1,18 @@
#! /usr/bin/env python
+
"""Simple test script for imgfile.c
Roger E. Masse
"""
-from test_support import verbose
-import imgfile
+from test_support import verbose, unlink
+
+import imgfile, uu, os
-
-def main():
+
+def main():
+
+ uu.decode(findfile('testrgb.uue'), 'test.rgb')
+ uu.decode(findfile('greyrgb.uue'), 'greytest.rgb')
# Test a 3 byte color image
testimage('test.rgb')
@@ -15,6 +20,16 @@ def main():
# Test a 1 byte greyscale image
testimage('greytest.rgb')
+ unlink('test.rgb')
+ unlink('greytest.rgb')
+
+def findfile(file):
+ if os.path.isabs(file): return file
+ import sys
+ for dn in sys.path:
+ fn = os.path.join(dn, file)
+ if os.path.exists(fn): return fn
+ return file
def testimage(name):
"""Run through the imgfile's battery of possible methods