def assert_str_equal(reference_str, test_str, format_str=u'String {str1} and {str2} do not match:\n{differences}'):
 if (reference_str != test_str):
  diff = difflib.unified_diff(reference_str.splitlines(1), test_str.splitlines(1), u'Reference', u'Test result', u'', u'', 0)
  raise ValueError(format_str.format(str1=reference_str, str2=test_str, differences=u''.join(diff)))

def assert_str_equal ( reference_str , test_str , format_str = u'String {str1} and {str2} do not match:\n{differences}' ) : if ( reference_str != test_str ) : diff = difflib . unified_diff ( reference_str . splitlines ( 1 ) , test_str . splitlines ( 1 ) , u'Reference' , u'Test result' , u'' , u'' , 0 ) raise ValueError ( format_str . format ( str1 = reference_str , str2 = test_str , differences = u'' . join ( diff ) ) )
assert the two strings are equal .