Use uuencoded test images.

This commit is contained in:
Guido van Rossum 1997-04-16 00:30:45 +00:00
parent 684480f419
commit 7aa9fc5642
4 changed files with 1579 additions and 9 deletions

View file

@ -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
def main():
import imgfile, uu, os
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