diff options
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_rgbimg.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_rgbimg.py b/Lib/test/test_rgbimg.py index 7418e69..cdadc66 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: |