diff options
author | Guido van Rossum <guido@python.org> | 1997-04-09 21:25:01 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-04-09 21:25:01 (GMT) |
commit | cb5cf9b1860faa4d878bff6ac3f454ddb8de1624 (patch) | |
tree | dd7a621de9240c2e88c3802f59a4437fae89f9d3 /Lib/test/test_rgbimg.py | |
parent | cee1dd3f9d26a04ec52317dcbb533af80b791a90 (diff) | |
download | cpython-cb5cf9b1860faa4d878bff6ac3f454ddb8de1624.zip cpython-cb5cf9b1860faa4d878bff6ac3f454ddb8de1624.tar.gz cpython-cb5cf9b1860faa4d878bff6ac3f454ddb8de1624.tar.bz2 |
Use uuencoded test images.
Diffstat (limited to 'Lib/test/test_rgbimg.py')
-rw-r--r-- | Lib/test/test_rgbimg.py | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/Lib/test/test_rgbimg.py b/Lib/test/test_rgbimg.py index 52814b4..f0f772c 100644 --- a/Lib/test/test_rgbimg.py +++ b/Lib/test/test_rgbimg.py @@ -1,6 +1,8 @@ # Testing rgbimg module -import rgbimg, os +import rgbimg, os, uu + +from test_support import verbose, unlink error = 'test_rgbimg.error' @@ -21,7 +23,7 @@ def testimg(rgb_file, raw_file): rgb = rgbimg.longimagedata(rgb_file) if len(rgb) != width * height * 4: raise error, 'bad image length' - raw = open(raw_file, 'r').read() + raw = open(raw_file, 'rb').read() if rgb != raw: raise error, \ 'images don\'t match for '+rgb_file+' and '+raw_file @@ -29,6 +31,21 @@ def testimg(rgb_file, raw_file): rgbimg.longstoimage(rgb, width, height, depth, '@.rgb') os.unlink('@.rgb') +table = [ + ('testrgb.uue', 'test.rgb'), + ('testimg.uue', 'test.rawimg'), + ('testimgr.uue', 'test.rawimg.rev'), + ] +for source, target in table: + source = findfile(source) + target = findfile(target) + if verbose: + print "uudecoding", source, "->", target, "..." + uu.decode(source, target) + +if verbose: + print "testing..." + ttob = rgbimg.ttob(0) if ttob != 0: raise error, 'ttob should start out as zero' @@ -48,3 +65,6 @@ if ttob != 1: ttob = rgbimg.ttob(0) if ttob != 0: raise error, 'ttob should be zero' + +for source, target in table: + unlink(findfile(target)) |