def image_comparison_expect_rms(im1, im2, tol, expect_rms):
 im1 = os.path.join(baseline_dir, im1)
 im2_src = os.path.join(baseline_dir, im2)
 im2 = os.path.join(result_dir, im2)
 shutil.copyfile(im2_src, im2)
 results = compare_images(im1, im2, tol=tol, in_decorator=True)
 if (expect_rms is None):
  assert_equal(None, results)
 else:
  assert (results is not None)
  assert_almost_equal(expect_rms, results[u'rms'], decimal=4)

def image_comparison_expect_rms ( im1 , im2 , tol , expect_rms ) : im1 = os . path . join ( baseline_dir , im1 ) im2_src = os . path . join ( baseline_dir , im2 ) im2 = os . path . join ( result_dir , im2 ) shutil . copyfile ( im2_src , im2 ) results = compare_images ( im1 , im2 , tol = tol , in_decorator = True ) if ( expect_rms is None ) : assert_equal ( None , results ) else : assert ( results is not None ) assert_almost_equal ( expect_rms , results [ u'rms' ] , decimal = 4 )
compare two images .