details: http://www.bx.psu.edu/hg/galaxy/rev/9ed4a26508ea changeset: 3563:9ed4a26508ea user: fubar: ross Lazarus at gmail period com date: Thu Mar 25 23:07:14 2010 -0400 description: added sim_size as a way of comparing (eg) .png outputs diffstat: test/base/twilltestcase.py | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diffs (16 lines): diff -r 0890f7bf9d49 -r 9ed4a26508ea test/base/twilltestcase.py --- a/test/base/twilltestcase.py Thu Mar 25 15:21:57 2010 -0400 +++ b/test/base/twilltestcase.py Thu Mar 25 23:07:14 2010 -0400 @@ -749,6 +749,12 @@ self.files_re_match( local_name, temp_name, attributes=attributes ) elif compare == 're_match_multiline': self.files_re_match_multiline( local_name, temp_name, attributes=attributes ) + elif compare == 'sim_size': + delta = attributes.get('delta','100') + s1 = len(data) + s2 = os.path.getsize(local_name) + if abs(s1-s2) > int(delta): + raise Exception, 'Files %s=%db but %s=%db - compare (delta=%s) failed' % (temp_name,s1,local_name,s2,delta) else: raise Exception, 'Unimplemented Compare type: %s' % compare except AssertionError, err: