def check(self, golden_file, test_file, options=[]): self.assertTrue(os.path.exists(test_file)) self.fetch_data(golden_file) msg = '' if os.path.exists(golden_file): diffs = gdalcompare.compare_db(gdal.Open(golden_file), gdal.Open(test_file), options=options) if diffs == 0: return msg += '\n' msg += 'Compare:\n' msg += ' Golden File: %s\n' % golden_file msg += ' Test Output: %s\n' % test_file else: msg += '\n' msg += 'No Golden File Exists.\n' msg += ' Test Output: %s\n' % test_file if not golden_file.startswith('/'): msg += '\n' msg += 'If result looks ok, update with:\n' msg += ' scp %s download.osgeo.org:/osgeo/download/plcompositor/%s' % ( test_file, golden_file) print msg raise Exception(msg)
def check(self, golden_file, test_file, options = []): self.assertTrue(os.path.exists(test_file)) self.fetch_data(golden_file) msg = '' if os.path.exists(golden_file): diffs = gdalcompare.compare_db(gdal.Open(golden_file), gdal.Open(test_file), options = options) if diffs == 0: return msg += '\n' msg += 'Compare:\n' msg += ' Golden File: %s\n' % golden_file msg += ' Test Output: %s\n' % test_file else: msg += '\n' msg += 'No Golden File Exists.\n' msg += ' Test Output: %s\n' % test_file msg += '\n' msg += 'If result looks ok, update with:\n' msg += ' scp %s download.osgeo.org:/osgeo/download/plcompositor/%s' % ( test_file, golden_file) print msg raise Exception(msg)