summaryrefslogtreecommitdiff
path: root/Lib/test/test_rgbimg.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1994-03-09 12:54:32 +0000
committerGuido van Rossum <guido@python.org>1994-03-09 12:54:32 +0000
commit4a5af6ac8735bcde797583681a91488d2050a818 (patch)
tree4ad77933ff49f069b6a36ba2bae28bfc11c0a281 /Lib/test/test_rgbimg.py
parent248ab585eccd89e031d7693d5421d2176217615a (diff)
downloadcpython-4a5af6ac8735bcde797583681a91488d2050a818.tar.gz
Search for test files in sys.path
Diffstat (limited to 'Lib/test/test_rgbimg.py')
-rw-r--r--Lib/test/test_rgbimg.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_rgbimg.py b/Lib/test/test_rgbimg.py
index 7418e69868..cdadc660dd 100644
--- a/Lib/test/test_rgbimg.py
+++ b/Lib/test/test_rgbimg.py
@@ -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: