Kaydet (Commit) b19d8623 authored tarafından Guido van Rossum's avatar Guido van Rossum

Search for test files in sys.path

üst 131e2abc
......@@ -6,7 +6,17 @@ error = 'test_rgbimg.error'
print 'RGBimg test suite:'
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 testimg(rgb_file, raw_file):
rgb_file = findfile(rgb_file)
raw_file = findfile(raw_file)
width, height = rgbimg.sizeofimage(rgb_file)
rgb = rgbimg.longimagedata(rgb_file)
if len(rgb) != width * height * 4:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment