mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Use uuencoded test images.
This commit is contained in:
parent
684480f419
commit
7aa9fc5642
4 changed files with 1579 additions and 9 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue